<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kasuni Ranasinghe on Medium]]></title>
        <description><![CDATA[Stories by Kasuni Ranasinghe on Medium]]></description>
        <link>https://medium.com/@kasunir?source=rss-5d08d7464cf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RNs0RBq_w_8xk7rsxMkQmg.jpeg</url>
            <title>Stories by Kasuni Ranasinghe on Medium</title>
            <link>https://medium.com/@kasunir?source=rss-5d08d7464cf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:09:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kasunir/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using JWT Authorizer to restrict access to the API’s in AWS API Gateway using an access token…]]></title>
            <link>https://kasunir.medium.com/use-jwt-authorizers-with-wso2-identity-server-and-aws-api-gateway-http-apis-f4e5220e7687?source=rss-5d08d7464cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4e5220e7687</guid>
            <category><![CDATA[aws-api-gateway]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[wso2is]]></category>
            <category><![CDATA[jwt-token]]></category>
            <dc:creator><![CDATA[Kasuni Ranasinghe]]></dc:creator>
            <pubDate>Sun, 01 Aug 2021 12:03:56 GMT</pubDate>
            <atom:updated>2022-09-03T19:03:20.082Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using JWT Authorizer to restrict access to the API’s in AWS API Gateway using an access token issued by WSO2 Identity Server</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FlfgxIvUa1FPfWj54jI%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fsecurity-restricted-authorized-personnel-lfgxIvUa1FPfWj54jI&amp;image=https%3A%2F%2Fmedia2.giphy.com%2Fmedia%2FlfgxIvUa1FPfWj54jI%2Fgiphy.gif%3Fcid%3D790b7611cb9f94d742ec7fc04d7321a168fa280d8d572c1f%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d423828612b933119a9a8581e4dd30e/href">https://medium.com/media/9d423828612b933119a9a8581e4dd30e/href</a></iframe><p>JWT Authorizer is a new feature introduced in AWS API Gateway which can be used to control the access of APIs deployed in AWS Api Gateway using Jason Web Jokens (JWT).</p><p>These Jason Web Tokens need to be used can be obtained by any external Identity Provider and today I’m gonna talk about how to use JWT Authorizers to restrict access to the API’s in AWS API Gateway using an access token issued by WSO2 Identity Server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-g4jB8dRpI4yvZ-B" /><figcaption><strong>Img1 : General flow</strong></figcaption></figure><p>Check the whole flow happening here below.</p><ol><li>The client application sends a HTTP request to the API with the JWT access token obtained from WSO2 Identity Server as an Authorization header in the API request.</li><li>The request received by the API Gateway of AWS sends the JWT access token to JWT Authorizer for validation.</li><li>JWT Authorizer sends a request to the WSO2 Identity server’s JWKS endpoint to get the public key of the authorization server in order to validate the JWT token.</li><li>WSO2 Identity Server returns the public key to the JWT Authorizer.</li><li>JWT Authorizer validates the JWT access token.</li><li>API Gateway runs the lambda functions and processes the request.</li><li>API gateway returns the Http response to the client application.</li></ol><p>Let’s move in to the steps need to be followed to test above mentioned scenario.</p><h3><strong>Step 1: Configure WSO2 Identity Server to obtain a JWT access token.</strong></h3><ol><li>Configure a service provider in WSO2 Identity Server under OpenId connect configurations. (You can use any preferred grant type here.)</li><li>Add the Token Issuer as “JWT”.</li><li>Send a request to the WSO2 Identity Server and obtain a JWT access token.</li></ol><h3><strong>Step 2: Create a HTTP API and a Lambda function on AWS.</strong></h3><ol><li>Refer below documentation to create a http api in AWS API gateway.​​<a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop.html#http-api-examples">https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop.html#http-api-examples</a></li><li>Navigate to AWS console and Create a simple lambda function and deploy it. (You can write any preferred business logic here)</li><li>Navigate to the AWS API Gateway and click on Build on HTTP API.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GXNCZ4qDFUDAuBDR" /><figcaption><strong>Img 2 :Create an API in AWS API Gateway</strong></figcaption></figure><p>Note : Make sure to select the created Lambda function in the Lambda function drop down and click on Next.</p><p>4. Configure routes with preferred methods and resource paths.</p><p>5. Finish creating the API after reviewing.</p><figure><img alt="Review api" src="https://cdn-images-1.medium.com/max/1024/0*aQUOzWLtjZRTVe7y" /><figcaption><strong>Img 3: Review API</strong></figcaption></figure><p>6. To test the created API, copy the Invoke url of the created API and navigate to postman.</p><p>7. Add the Get method resource path and send a GET request to test the API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uUrsB7ggV8wciz6h" /><figcaption><strong>Img 4 :Test the created API</strong></figcaption></figure><p>Now we have finished creating a new Http API with a simple lambda function and you will be able to see that a User can access the GET method of the created API without any restrictions.</p><p>Let’s see how to restrict the access to the above created API using a JWT Authorizer.</p><h3>Step 3: <strong>Add a JWT Authorizer to Your API</strong></h3><p>Let’s add the JWT Authorization header to restrict the access to this API’s GET method only for the users who are having valid access tokens issued by WSO2IS.(Users who are only successfully authenticated from WSO2IS)</p><ol><li>Navigate to the API created and click on Routes. Here if you click on any method you will be able to see that there are No authorizers attached to this route.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wIxHSrRAy_y-5GUM" /><figcaption><strong>Img 5 :Route details of an API</strong></figcaption></figure><p>2. Click on “Attach Authorization”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NHcOEDrUvTyaZ8aW" /><figcaption><strong>Img 6 :Attach Authorization</strong></figcaption></figure><p>3. Then click on Create and attach an authorizer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kk9tUpGsvAgXRV_e" /><figcaption><strong>Img 7 :Select JWT Authorizer</strong></figcaption></figure><p>4. Here select JWT as the Authorizer type and enter the other information as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a0uLXj3eGLASDJpz" /><figcaption><strong>Img 8 : Enter information of Identity Provider</strong></figcaption></figure><p>Let’s get to know what these fields are :</p><ul><li><strong>Name </strong>: A name for the authorizer. You can enter any name you prefer.</li><li><strong>Identity source</strong> : In which part of the request you are sending the JWT token. Header, body etc. Since we are sending in the request header as the Authorization Header here, we configure as <strong>$request.header.Authorization</strong></li><li><strong>Issuer URL</strong> : The issuer url of the WSO2 Identity Server. This must be equal to the “iss” value of the decoded JWT token.</li><li><strong>Audienc</strong>e : Client id value of the service provider configured in WSO2IS. This must be equal to the “aud” value of the decoded JWT token.</li></ul><p>5. Click on Create and attach</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uZvDoDRR636NSITz" /><figcaption><strong>Img 9 : Finish attaching the authorizer</strong></figcaption></figure><p>Now you will be able to see in the <a href="https://us-east-2.console.aws.amazon.com/apigateway/main/develop/auth">Authorization</a> tab in API, there is a JWT Auth authorizer that has been configured.</p><h3>Step 4: <strong>Test It Out!</strong></h3><p>Let’s test the flow with newly added authorizer.</p><ol><li>Navigate to postman and try to send the same GET request to the api endpoint.</li><li>You will be able to see that you received an error message saying “Unauthorized” .</li><li>Since we added a JWT Authorizer we need to send the valid JWT token in a request header when calling the API resources.</li><li>In Headers section of postman request, add a new header called “Authorization” and add the value as “&lt;Bearer &lt;JWT TOKEN Value&gt;&gt;” with the prefix Bearer.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-DctP2GiEohFiSb8" /><figcaption><strong>Img 10 : Try out the API with JWT Authorization header</strong></figcaption></figure><p>5. Enable the header and send the request again.</p><p>6.Now you will be able to see that you can access the API resource successfully.</p><p>🌟 You would also be able to see that if you send an expired JWT Token (Invalid token) that the access to the Api fails since the validation at the JWT Authorizer fails.</p><p>As a last note let me explain how this JWT Authorizer of AWS API Gateway validates the external identity provider’s JWT token.</p><p>As you may know there are two ways,</p><ul><li>To let the external Identity Provider to validate the JWT token, and ask for a valid response, (Here you will need to integrate the AWS API gateway with external IDP (WSO2 IS).)</li><li>And to obtain the public certificate of external Identity Provider and validate it by it self.</li></ul><p>In JWT authorizer of AWS API Gateway uses the second approach.</p><p>API Gateway uses the following general workflow to authorize requests to routes that are configured to use a JWT authorizer. (Source: <a href="https://github.com/awsdocs/amazon-api-gateway-developer-guide/blob/eab79ce74f7e8ec59567fea32f804d8ba4570f35/doc_source/http-api-jwt-authorizer.md">https://github.com/awsdocs/amazon-api-gateway-developer-guide/blob/eab79ce74f7e8ec59567fea32f804d8ba4570f35/doc_source/http-api-jwt-authorizer.md</a>)</p><ol><li>Check the identity source for a token. This can include only the token or token prefixed with Bearer.</li><li>Decode the token.</li><li>Check the token’s algorithm and signature by using the public key that is fetched from the issuer’s jwks_uri. Currently, only RSA-based algorithms are supported. (jwks_uri will be obtained by the issuer url configured and the well known end point meta data will be used.)</li><li>Validate claims. API Gateway evaluates the following token claims:</li></ol><ul><li>The token must have a header claim that matches the key in the jwks_uri that signed the token.</li><li>Must match the issuer and Audience configured.</li><li>Client_id of the Service provider must match with the “aud” claim value.</li><li>“exp” value must be after the current time in UTC</li><li>“nbf” value must be before the current time in UTC.</li><li>“iat” value must be before the current time in UTC.</li></ul><p>If any of above fails, the API Gateway denies the API request.</p><p>This is all about using JWT Authorizers with WSO2 Identity Server and AWS API Gateway HTTP APIs.</p><p>Hope this would help anyone who tries to achieve the validation of JWT tokens with AWS API Gateway JWT tokens with external IDPs and please leave comments and issues down there.👇</p><p>Have a great time 🥳</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4e5220e7687" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure Your Active Directory As A Secondary User Store In WSO2IS-5.10.0]]></title>
            <link>https://kasunir.medium.com/configure-your-active-directory-as-a-secondary-user-store-in-wso2is-5-10-0-b9e677e04001?source=rss-5d08d7464cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9e677e04001</guid>
            <category><![CDATA[wso2is]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[secondary-user-store]]></category>
            <category><![CDATA[scim]]></category>
            <dc:creator><![CDATA[Kasuni Ranasinghe]]></dc:creator>
            <pubDate>Thu, 24 Dec 2020 08:18:07 GMT</pubDate>
            <atom:updated>2021-11-22T08:01:33.518Z</atom:updated>
            <content:encoded><![CDATA[<h3>Configure your Active Directory As A Secondary User Store In WSO2IS-5.10.0</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPT9-g9brw3UsSfhfedPQg.jpeg" /></figure><p>Hey Guys,</p><p>Recently I have noticed lot of people who work with WSO2 Identity Server struggle with configuring their Active Directory as a Secondary User Store. In this blog I’m trying to bring you all the points you need to know when configuring an Active Directory as a Secondary User Store with WSO2 Identity Server.</p><p>With the release of WSO2IS-5.10.0 version we have introduced new user store manager class types hence you will be able to see following user store manager classes to choose under Active directory User Store Manager Class drop down list.</p><blockquote><strong><em>org.wso2.carbon.user.core.ldap.ActiveDirectoryUserStoreManager.</em></strong></blockquote><blockquote><strong><em>org.wso2.carbon.user.core.ldap.UniqueIDActiveDirectoryUserStoreManager.</em></strong></blockquote><p>You can choose above two user store manager classes as your preference but with newer versions we recommend to use <strong><em>org.wso2.carbon.user.core.ldap.UniqueIDActiveDirectoryUserStoreManager</em> </strong>unless you are not migrating from a previous version of Identity Server.</p><p>Configuring Active Directory with WSO2IS is pretty simple if you are aware of user store configurations and claim mappings need to be done.</p><p><strong>Step 1 — <em>Configure User Store</em></strong></p><p>There are two approaches you can follow as below.</p><p><strong>1.Configure through WSO2IS management console.</strong></p><p><strong>2.Deploying the user store file directly through file configurations.</strong></p><p>Let’s discuss how to use above two approaches separately.</p><p><strong>1.Configure using WSO2IS Management Console.</strong></p><ul><li>- Download WSO2IS-5.10.0 version and start the server.</li><li>- Go to Management Console — -&gt; User Stores → Add.</li><li>- Choose the user store manager class type and fill in other details.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jj5RFIcpM0B1HOiLKEY8mQ.png" /><figcaption>Configure via management console</figcaption></figure><ul><li>- Click on ADD</li></ul><p><strong>2- Deploying the user store file directly using file configurations.</strong></p><ul><li>Navigate to &lt;IS_HOME&gt;repository/deployment/server/userstores folder. (Note : If you do not have any existing secondary user stores the userstores folder will not be available. In that case you will have to create the userstores folder manually.)</li><li>Place the userstore file directly inside userstores folder as an xml file.EX : abc.xml.</li><li>Use the below user store file configurations if you are using the <strong><em>org.wso2.carbon.user.core.ldap.ActiveDirectoryUserStoreManager </em></strong><em>class to configure the user store.</em></li></ul><p><strong><em>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;&lt;UserStoreManager class=”org.wso2.carbon.user.core.ldap.ActiveDirectoryUserStoreManager”&gt;<br> &lt;Property name=”ConnectionURL”&gt;***************&lt;/Property&gt;<br> &lt;Property name=”ConnectionName”&gt;CN=ADMIN,CN=Users,DC=abc,DC=abcd&lt;/Property&gt;<br> &lt;Property name=”ConnectionPassword”&gt;*************&lt;/Property&gt;<br> &lt;Property name=”UserSearchBase”&gt;CN=Users,DC=abc,DC=abcd&lt;/Property&gt;<br> &lt;Property name=”UserEntryObjectClass”&gt;user&lt;/Property&gt;<br> &lt;Property name=”UserNameAttribute”&gt;cn&lt;/Property&gt;<br> &lt;Property name=”UserNameSearchFilter”&gt;(&amp;amp;(objectClass=user)(cn=?))&lt;/Property&gt;<br> &lt;Property name=”UserNameListFilter”&gt;(objectClass=user)&lt;/Property&gt;<br> &lt;Property name=”UserDNPattern”/&gt;<br> &lt;Property name=”DisplayNameAttribute”/&gt;<br> &lt;Property name=”Disabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”ReadGroups”&gt;true&lt;/Property&gt;<br> &lt;Property name=”WriteGroups”&gt;true&lt;/Property&gt;<br> &lt;Property name=”GroupSearchBase”&gt;CN=Users,DC=abc,DC=abcd&lt;/Property&gt;<br> &lt;Property name=”GroupEntryObjectClass”&gt;group&lt;/Property&gt;<br> &lt;Property name=”GroupNameAttribute”&gt;cn&lt;/Property&gt;<br> &lt;Property name=”GroupNameSearchFilter”&gt;(&amp;amp;(objectClass=group)(cn=?))&lt;/Property&gt;<br> &lt;Property name=”GroupNameListFilter”&gt;(objectcategory=group)&lt;/Property&gt;<br> &lt;Property name=”RoleDNPattern”/&gt;<br> &lt;Property name=”MembershipAttribute”&gt;member&lt;/Property&gt;<br> &lt;Property name=”MemberOfAttribute”&gt;memberOf&lt;/Property&gt;<br> &lt;Property name=”BackLinksEnabled”&gt;true&lt;/Property&gt;<br> &lt;Property name=”Referral”&gt;follow&lt;/Property&gt;<br> &lt;Property name=”UserNameJavaRegEx”&gt;[a-zA-Z0–9._-|//]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”UserNameJavaScriptRegEx”&gt;^[\S]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”UsernameJavaRegExViolationErrorMsg”&gt;Username pattern policy violated.&lt;/Property&gt;<br> &lt;Property name=”PasswordJavaRegEx”&gt;^[\S]{5,30}$&lt;/Property&gt;<br> &lt;Property name=”PasswordJavaScriptRegEx”&gt;^[\S]{5,30}$&lt;/Property&gt;<br> &lt;Property name=”PasswordJavaRegExViolationErrorMsg”&gt;Password pattern policy violated.&lt;/Property&gt;<br> &lt;Property name=”RoleNameJavaRegEx”&gt;^[a-zA-Z0–9._-|//]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”RoleNameJavaScriptRegEx”&gt;^[\S]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”BulkImportSupported”&gt;true&lt;/Property&gt;<br> &lt;Property name=”EmptyRolesAllowed”&gt;true&lt;/Property&gt;<br> &lt;Property name=”PasswordHashMethod”&gt;PLAIN_TEXT&lt;/Property&gt;<br> &lt;Property name=”MultiAttributeSeparator”&gt;,&lt;/Property&gt;<br> &lt;Property name=”isADLDSRole”&gt;false&lt;/Property&gt;<br> &lt;Property name=”userAccountControl”&gt;512&lt;/Property&gt;<br> &lt;Property name=”MaxUserNameListLength”&gt;100&lt;/Property&gt;<br> &lt;Property name=”MaxRoleNameListLength”&gt;100&lt;/Property&gt;<br> &lt;Property name=”kdcEnabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”defaultRealmName”&gt;WSO2.ORG&lt;/Property&gt;<br> &lt;Property name=”UserRolesCacheEnabled”&gt;true&lt;/Property&gt;<br> &lt;Property name=”ConnectionPoolingEnabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”LDAPConnectionTimeout”&gt;5000&lt;/Property&gt;<br> &lt;Property name=”ReadTimeout”&gt;5000&lt;/Property&gt;<br> &lt;Property name=”RetryAttempts”&gt;0&lt;/Property&gt;<br> &lt;Property name=”CountRetrieverClass”/&gt;<br> &lt;Property name=”java.naming.ldap.attributes.binary”&gt;objectGuid&lt;/Property&gt;<br> &lt;Property name=”ClaimOperationsSupported”&gt;true&lt;/Property&gt;<br> &lt;Property name=”transformObjectGUIDToUUID”&gt;true&lt;/Property&gt;<br> &lt;Property name=”MembershipAttributeRange”&gt;1500&lt;/Property&gt;<br> &lt;Property name=”UserCacheExpiryMilliseconds”/&gt;<br> &lt;Property name=”UserDNCacheEnabled”&gt;true&lt;/Property&gt;<br> &lt;Property name=”StartTLSEnabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”EnableMaxUserLimitForSCIM”&gt;false&lt;/Property&gt;<br> &lt;Property name=”ImmutableAttributes”&gt;objectGuid,whenCreated,whenChanged&lt;/Property&gt;<br> &lt;Property name=”TimestampAttributes”&gt;whenChanged,whenCreated&lt;/Property&gt;<br> &lt;Property name=”DomainName”&gt;abc&lt;/Property&gt;<br> &lt;Property name=”Description”/&gt;<br>&lt;/UserStoreManager&gt;</em></strong></p><p>Use below user store configurations if you are using the <strong><em>UniqueIDActiveDirectoryUserStoreManager.</em></strong></p><p><strong><em>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;&lt;UserStoreManager class=”org.wso2.carbon.user.core.ldap.UniqueIDActiveDirectoryUserStoreManager”&gt;<br> &lt;Property name=”ConnectionURL”&gt;***************&lt;/Property&gt;<br> &lt;Property name=”ConnectionName”&gt;CN=ADMIN,CN=Users,DC=abc,DC=abcd&lt;/Property&gt;<br> &lt;Property name=”ConnectionPassword”&gt;*************&lt;/Property&gt;<br> &lt;Property name=”UserSearchBase”&gt;CN=Users,DC=abc,DC=abcd&lt;/Property&gt;<br> &lt;Property name=”UserEntryObjectClass”&gt;user&lt;/Property&gt;<br> &lt;Property name=”UserNameAttribute”&gt;cn&lt;/Property&gt;</em></strong></p><p><strong>&lt;Property name=”UserIDAttribute”&gt;<em>objectGuid</em>&lt;/Property&gt;</strong></p><p><strong>&lt;Property name=”UserIdSearchFilter”&gt;(&amp;amp;(objectClass=user)(<em>objectGuid</em>=?))&lt;/Property&gt;<em><br> &lt;Property name=”UserNameSearchFilter”&gt;(&amp;amp;(objectClass=user)(cn=?))&lt;/Property&gt;<br> &lt;Property name=”UserNameListFilter”&gt;(objectClass=user)&lt;/Property&gt;<br> &lt;Property name=”UserDNPattern”/&gt;<br> &lt;Property name=”DisplayNameAttribute”/&gt;<br> &lt;Property name=”Disabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”ReadGroups”&gt;true&lt;/Property&gt;<br> &lt;Property name=”WriteGroups”&gt;true&lt;/Property&gt;<br> &lt;Property name=”GroupSearchBase”&gt;CN=Users,DC=abc,DC=abcd&lt;/Property&gt;<br> &lt;Property name=”GroupEntryObjectClass”&gt;group&lt;/Property&gt;<br> &lt;Property name=”GroupNameAttribute”&gt;cn&lt;/Property&gt;<br> &lt;Property name=”GroupNameSearchFilter”&gt;(&amp;amp;(objectClass=group)(cn=?))&lt;/Property&gt;<br> &lt;Property name=”GroupNameListFilter”&gt;(objectcategory=group)&lt;/Property&gt;<br> &lt;Property name=”RoleDNPattern”/&gt;<br> &lt;Property name=”MembershipAttribute”&gt;member&lt;/Property&gt;<br> &lt;Property name=”MemberOfAttribute”&gt;memberOf&lt;/Property&gt;<br> &lt;Property name=”BackLinksEnabled”&gt;true&lt;/Property&gt;<br> &lt;Property name=”Referral”&gt;follow&lt;/Property&gt;<br> &lt;Property name=”UserNameJavaRegEx”&gt;[a-zA-Z0–9._-|//]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”UserNameJavaScriptRegEx”&gt;^[\S]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”UsernameJavaRegExViolationErrorMsg”&gt;Username pattern policy violated.&lt;/Property&gt;<br> &lt;Property name=”PasswordJavaRegEx”&gt;^[\S]{5,30}$&lt;/Property&gt;<br> &lt;Property name=”PasswordJavaScriptRegEx”&gt;^[\S]{5,30}$&lt;/Property&gt;<br> &lt;Property name=”PasswordJavaRegExViolationErrorMsg”&gt;Password pattern policy violated.&lt;/Property&gt;<br> &lt;Property name=”RoleNameJavaRegEx”&gt;^[a-zA-Z0–9._-|//]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”RoleNameJavaScriptRegEx”&gt;^[\S]{3,30}$&lt;/Property&gt;<br> &lt;Property name=”BulkImportSupported”&gt;true&lt;/Property&gt;<br> &lt;Property name=”EmptyRolesAllowed”&gt;true&lt;/Property&gt;<br> &lt;Property name=”PasswordHashMethod”&gt;PLAIN_TEXT&lt;/Property&gt;<br> &lt;Property name=”MultiAttributeSeparator”&gt;,&lt;/Property&gt;<br> &lt;Property name=”isADLDSRole”&gt;false&lt;/Property&gt;<br> &lt;Property name=”userAccountControl”&gt;512&lt;/Property&gt;<br> &lt;Property name=”MaxUserNameListLength”&gt;100&lt;/Property&gt;<br> &lt;Property name=”MaxRoleNameListLength”&gt;100&lt;/Property&gt;<br> &lt;Property name=”kdcEnabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”defaultRealmName”&gt;WSO2.ORG&lt;/Property&gt;<br> &lt;Property name=”UserRolesCacheEnabled”&gt;true&lt;/Property&gt;<br> &lt;Property name=”ConnectionPoolingEnabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”LDAPConnectionTimeout”&gt;5000&lt;/Property&gt;<br> &lt;Property name=”ReadTimeout”&gt;5000&lt;/Property&gt;<br> &lt;Property name=”RetryAttempts”&gt;0&lt;/Property&gt;<br> &lt;Property name=”CountRetrieverClass”/&gt;<br> &lt;Property name=”java.naming.ldap.attributes.binary”&gt;objectGuid&lt;/Property&gt;<br> &lt;Property name=”ClaimOperationsSupported”&gt;true&lt;/Property&gt;<br> &lt;Property name=”transformObjectGUIDToUUID”&gt;true&lt;/Property&gt;<br> &lt;Property name=”MembershipAttributeRange”&gt;1500&lt;/Property&gt;<br> &lt;Property name=”UserCacheExpiryMilliseconds”/&gt;<br> &lt;Property name=”UserDNCacheEnabled”&gt;true&lt;/Property&gt;<br> &lt;Property name=”StartTLSEnabled”&gt;false&lt;/Property&gt;<br> &lt;Property name=”EnableMaxUserLimitForSCIM”&gt;false&lt;/Property&gt;<br> &lt;Property name=”ImmutableAttributes”&gt;objectGuid,whenCreated,whenChanged&lt;/Property&gt;<br> &lt;Property name=”TimestampAttributes”&gt;whenChanged,whenCreated&lt;/Property&gt;<br> &lt;Property name=”DomainName”&gt;abc&lt;/Property&gt;<br> &lt;Property name=”Description”/&gt;<br>&lt;/UserStoreManager&gt;</em></strong></p><p><strong><em>Tip </em></strong>— You do not have to restart the server after applying the configuration file as IS will hot deploy the secondary user store configurations.</p><p><strong>Step 2</strong> — <strong>Import User store public certificate to WSO2IS client trust store</strong></p><p>We need to import AD user store public certificate to WSO2 Identity Server’s client trust store as the next step. For this you need to navigate to &lt;IS_HOME&gt;repository/resources/security folder and execute following command to import the certificate to client-truststore of WSO2IS.</p><pre>keytool -import -alias certalias -file &lt;certificate&gt;.pem -keystore client-truststore.jks -storepass wso2carbon</pre><p>⭐️ Please note that ‘wso2carbon’ is the keystore password of the default client-truststore.jks file of WSO2IS.</p><p><strong>Step 3— Perform Claim Mappings</strong></p><p>For active directory user stores we need to add new claim mappings apart from the existing default claim mappings given for Primary LDAP user store in claim mapping configurations. This is mainly because some of the attributes in LDAP are not present in Active Directory User stores. WSO2 Identity Server will use its own set of configurations called claims to deal with the database attributes.Hence if we do not map the required claims with available attributes it will throw different LDAP errors when we perform operations on the newly configured AD secondary users.This is mainly needed when you are dealing with SCIM based functions.In previous versions of WSO2 IS, SCIM was not enabled by default hence we could proceed without the claim mappings. But in IS-5.10.0 we have enabled SCIM by default hence it is mandatory to add these claim mappings.</p><p>Following are the mandatory basic claim mappings need to be done and this will be extended as per your requirements.</p><p><a href="http://wso2.org/claims/location"><strong><em>http://wso2.org/claims/location</em></strong></a><strong><em> -&gt; streetAddress<br> </em></strong><a href="http://wso2.org/claims/resourceType"><strong><em>http://wso2.org/claims/resourceType</em></strong></a><strong><em> -&gt; unixHomeDirectory<br> </em></strong><a href="http://wso2.org/claims/im"><strong><em>http://wso2.org/claims/im</em></strong></a><strong><em> -&gt; userWorkstations<br> </em></strong><a href="http://wso2.org/claims/created"><strong><em>http://wso2.org/claims/created</em></strong></a><strong><em> -&gt; whenCreated<br> </em></strong><a href="http://wso2.org/claims/userid"><strong><em>http://wso2.org/claims/userid</em></strong></a><strong><em> -&gt; objectGuid<br> </em></strong><a href="http://wso2.org/claims/modified"><strong><em>http://wso2.org/claims/modified</em></strong></a><strong><em> -&gt; whenChanged<br> </em></strong><a href="http://wso2.org/claims/username"><strong><em>http://wso2.org/claims/username</em></strong></a><strong><em> -&gt; cn</em></strong></p><p><strong>Step 4 — Configure additional Properties</strong></p><p><strong><em>Timestamp Attributes</em></strong></p><p>Among above attributes, whenChanged and whenCreated should be added as timestamp attributes to support time format transformation. In AD, timestamp values are stored in Generalized-Time format. Therefore when reading time values from AD and passing these values to WSO2IS requires a time conversion to UTC time format. This can be added directly to the user store.xml file or configured through management console under user store configurations as well.</p><ul><li>To configure directly in userstore.xml file add the following property.</li></ul><p><strong><em>&lt;Property name=”TimestampAttributes”&gt;whenChanged,whenCreated&lt;/Property&gt;</em></strong></p><ul><li>To configure via management console navigate to <strong>Userstores → List → Edit → Advanced →<em>TimestampAttributes</em> </strong>and add the attributes.</li></ul><p><strong><em>Immutable Attributes</em></strong></p><p>As the word implies immutable means “unable to be changed”. AD has it’s own set of immutable attributes like “ObjectGUID” as the ImmutableID , whenChanged,whenCreated (Timestamp Attributes)etc.</p><p>Therefore when working with AD changes we need to handle these properly.WSO2 Identity Server has handled this with a user store property where we can configure the immutable attributes at user store manager level and skip updating.</p><p><strong><em>&lt;Property name=”ImmutableAttributes”&gt;objectGuid,whenCreated,whenChanged&lt;/Property&gt;</em></strong></p><p>When you add the above attributes as ImmutableAttributes WSO2IS will not try to update those attributes when doing user operations and it will not lead to any errors when performing user operations. You can configure these properties as per your choice according to your AD requirements.</p><ul><li>This is also can be configured via management console and please refer the image attached below.</li></ul><p><strong>About ObjectGUID attribute</strong></p><p>ObjectGUID is used as the ImmutableID in Active Directories and is used as the best identifier for most of the applications for various reasons. You may also need to use the objectGUID attribute as a unique attribute and mapped into a local claim in WSO2IS. To do this you need to add objectGUID under immutableAttributes like stated above and also should add below properties in your user store configuration file.</p><p><strong><em>&lt;Property name=”transformObjectGUIDToUUID”&gt;true&lt;/Property&gt;</em></strong></p><p><strong><em>&lt;Property name=”java.naming.ldap.attributes.binary”&gt;objectGuid&lt;/Property&gt;</em></strong></p><p>The above properties need to be added into userstore configurations as objectGUID is a binary attribute and need to be converted it into a required format within WSO2IS.</p><p>To configure the same via management console you need to enable following properties under Advanced section.</p><ul><li><strong><em>Return objectGUID in UUID Canonical Format = Enable True</em></strong></li><li><strong><em>Add objectGUID as LDAP binary attributes</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AoGft_ahFE7XmvPNUbvQvQ.png" /></figure><p>With this we have completed all the required steps to configure your AD as a secondary user store in WSO2 Identity Server 😌</p><p>Have a great time playing with WSO2IS 😃</p><h3>References</h3><ul><li><a href="https://is.docs.wso2.com/en/5.10.0/setup/configuring-a-read-write-active-directory-user-store/">Configuring a Read-Write Active Directory User Store - WSO2 Identity Server Documentation</a></li><li><a href="https://is.docs.wso2.com/en/5.10.0/learn/configuring-user-stores-for-scim-2.0-based-inbound-provisioning/">Configuring User Stores for SCIM 2.0 based inbound provisioning - WSO2 Identity Server Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9e677e04001" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>