Pages

Wednesday, 21 January 2015

Connect the WSO2 Product to an External LDAP User Store


Here i would like to share that how to connect WSO2 product with LDAP user store ,I explaining with the API manager


STEP 1 : Logging to https://localhost:9443/carbon
STEP 2: Select the user store adding option as follows


STEP 3 : fill the  UI with connection details (LDAP Configuration)



Sample XML file of above configuration as follows

<?xml version="1.0" encoding="UTF-8"?><UserStoreManager     class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
  <Property name="ConnectionName">cn=admin,dc=ds,dc=sample,dc=com</Property>
  <Property name="ConnectionURL">ldap://192.168.1.1:389</Property>
  <Property name="ConnectionPassword">XXXX</Property>
  <Property name="UserSearchBase">ou=People,dc=prime,dc=ds,dc=sample,dc=com</Property>
  <Property name="Disabled">false</Property>
  <Property name="UserNameListFilter">(objectClass=inetOrgPerson)</Property>
  <Property name="UserNameAttribute">uid</Property>
  <Property name="UserNameSearchFilter">(&amp;(objectClass=inetOrgPerson)(uid=?))</Property>
  <Property name="UserEntryObjectClass">inetOrgPerson</Property>
  <Property name="GroupEntryObjectClass">organizationalUnit</Property>
  <Property name="ReadGroups">false</Property>
  <Property name="GroupSearchBase">ou=People,dc=prime,dc=ds,dc=sample,dc=com</Property>
  <Property name="GroupNameAttribute">uid</Property>
  <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
  <Property name="MembershipAttribute">member</Property>
  <Property name="GroupNameSearchFilter">(&amp;(objectClass=groupOfNames)(ou=?))</Property>
  <Property name="MaxUserNameListLength">100</Property>
  <Property name="MaxRoleNameListLength">100</Property>
  <Property name="UserRolesCacheEnabled">true</Property>
  <Property name="SCIMEnabled">false</Property>
  <Property name="PasswordHashMethod">SHA</Property>
  <Property name="UserDNPattern">uid={0},ou=People,dc=prime,dc=ds,dc=sample,dc=com</Property>
  <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
  <Property name="UserNameJavaScriptRegEx">^[\S]{3,30}$</Property>
  <Property name="UserNameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
  <Property name="RoleNameJavaScriptRegEx">^[\S]{3,30}$</Property>
  <Property name="RoleNameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
  <Property name="WriteGroups">true</Property>
  <Property name="EmptyRolesAllowed">true</Property>
  <Property name="DomainName">ldap</Property>
  <Property name="Description">ldap
        </Property>
</UserStoreManager>

Now API manger connected with LDAP  user store

Note :

Please ensure that you  filled the   'User DN Pattern ' field