This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Configuring a Read-write LDAP User Store

Before you begin!

Read-write LDAP user store manager configured with org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager user store manager class.

In this page, you can find information on:  

Properties used in Read-write LDAP userstore manager

Property NameDisplay NameDescription
DomainNameDomain NameUnique name to identify the user store. This should be configured only for secondary user stores.
ConnectionURLConnection URL

This is the Connection URL to the user store server. In the case of default LDAP in Carbon, the port is specified in the carbon.xml file, and a reference to that port is included in this configuration.

Sample values:
ldap://10.100.1.100:389
ldaps://10.100.1.102:639

If you are connecting over ldaps (secured LDAP), you need to import the certificate of user store to the client-truststore.jks of the WSO2 product. For information on how to add certificates to the truststore and how keystores are configured and used in a system, see Using Asymmetric Encryption.
https://docs.wso2.com/display/ADMIN44x/Using+Asymmetric+Encryption

If LDAP connection pooling is used, see enable connection pooling for LDAPS connections.
https://docs.wso2.com/display/ADMIN44x/Performance+Tuning#PerformanceTuning-ldaps_pooling

ConnectionNameConnection Name

The username used to connect to the user store and perform various operations. This user does not need to be an administrator in the user store or have an administrator role in the WSO2 product that you are using, but this user MUST have permissions to read the user list and users' attributes and to perform search operations on the user store. The value you specify is used as the DN (Distinguish Name) attribute of the user who has sufficient permissions to perform operations on users and roles in LDAP

This property is mandatory.

Sample values: uid=admin,ou=system

ConnectionPasswordConnection PasswordPassword for the ConnectionName user.
UserSearchBaseUser Search Based

DN of the context or object under which the user entries are stored in the user store. When the user store searches for users, it will start from this location of the directory

Sample values: ou=Users,dc=wso2,dc=org

UserEntryObjectClassUser Entry Object Class

Object class used to construct user entries.

Default: wso2Person (Is a custom object class defined in WSO2 products)

UserNameAttributeUsername Attribute

The attribute used for uniquely identifying a user entry. Users can be authenticated using their email address, UID, etc. The name of the attribute is considered as the username.

Sample values:uid

Note: email address is considered as a special case in all WSO2 products. If you want to set the email address as username, see https://docs.wso2.com/display/IS530/Using+Email+Address+as+the+Username

UserNameSearchFilterUser Search Filter

Filtering criteria used to search for a particular user entry.

Sample values: (&(objectClass=person)(uid=?))

UserNameListFilterUser List Filter

Filtering criteria for searching user entries in the user store. This query or filter is used when doing search operations on users with different search attributes.

Sample values: (objectClass=person)

In this case, the search operation only provides the objects created from the person object class.

UserDNPatternUser DN Pattern

The pattern for the user's DN, which can be defined to improve the search. When there are many user entries in the LDAP user store, defining a UserDNPattern provides more impact on performances as the LDAP does not have to traverse through the entire tree to find users.

Sample values: uid={0},ou=Users,dc=wso2,dc=org

DisplayNameAttributeDisplay name attributeThis is an optional property. The Display Name Attribute is the name by which users will be listed when you list users in the management console.
DisabledDisabled

This is to deactivate the user store. If you need to temporarily deactivate a user store, you can use this option. If you disable the user store from the disable option it also will set this parameter.

Default: false

Possible values:
true : Disable user store temporarily.

ReadGroupsRead GroupsWhen WriteGroups is set to 'false', this Indicates whether groups should be read from the user store. If this is disabled by setting it to 'false', none of the groups in the user store can be read, and the following group configurations are NOT mandatory: GroupSearchBase, GroupNameListFilter, or GroupNameAttribute.

Possible values:
true: Read groups from user store
false: Do not read groups from user store
WriteGroupsWrite GroupsIndicates whether groups should be written to the user store.

Possible values:
true: Write groups to user store
false: Do not write groups to user store, so only internal roles can be created. Depending on the value of ReadGroups property, it will read existing groups from user store or not
GroupSearchBaseGroup Search Base

DN of the context or object under which the group entries are stored in the user store. When the user store searches for groups, it will start from this location of the directory.

Sample values: ou=Groups,dc=wso2,dc=org

GroupEntryObjectClassGroup Entry Object Class

Object class used to construct group entries.

Sample values: groupOfNames

GroupNameSearchFilterGroup Search Filter

Filtering criteria used to search for a particular group entry.

Sample values: (&(objectClass=groupOfNames)(cn=?))

GroupNameListFilterGroup List Filter

Filtering criteria for searching group entries in the user store. This query or filter is used when doing search operations on groups with different search attributes.

Sample values: ((objectClass=groupOfNames)).

In this case, the search operation only provides the objects created from the groupOfName object class.

RoleDNPatternRole DN Pattern

The pattern for thegroups'sDN, which can be defined to improve the search. When there are many group entries in the LDAP user store, defining a RoleDNPattern provides more impact on performances as the LDAP does not have to travel through the entire tree to find groups.

Sample values: cn={0},ou=Groups,dc=wso2,dc=org

MembershipAttributeMembership Attribute

Define the attribute that contains the distinguished names (DN) of user objects that are in a group.

Possible values: member

MemberOfAttributeMember Of AttributeDefine the attribute that contains the distinguished names (DN) of group objects that user is assigned to.
Possible values: memberOf
BackLinksEnabledEnable Back LinksDefine whether the backlink support is enabled. If you are using MemberOfAttribute attributes this should be set to true.
UsernameJavaRegExUsername RegEx (Java)

The regular expression used by the back-end components for username validation. By default, strings with non-empty characters have a length of 3 to 30 allowed. You can provide ranges of alphabets, numbers and also ranges of ASCII values in the RegEx properties.

Default: [a-zA-Z0-9._-|//]{3,30}$

UsernameJavaScriptRegExUsername RegEx (Javascript)

The regular expression used by the front-end components for username validation.

Default: ^[\S]{3,30}$

UsernameJavaRegExViolationErrorMsgUsername RegEx Violation Error MessageError message when the Username is not matched with UsernameJavaRegEx
PasswordJavaRegExPassword RegEx (Java)

The regular expression used by the back-end components for password validation. By default, strings with non-empty characters have a length of 5 to 30 allowed. You can provide ranges of alphabets, numbers and also ranges of ASCII values in the RegEx properties.

Default: ^[\S]{5,30}$

PasswordJavaScriptRegExPassword RegEx (Javascript)

The regular expression used by the front-end components for password validation.

Default: ^[\S]{5,30}$

PasswordJavaRegExViolationErrorMsgPassword RegEx Violation Error MessageError message when the Password is not matched with passwordJavaRegEx
RolenameJavaRegExRole Name RegEx (Java)

The regular expression used by the back-end components for role name validation. By default, strings with non-empty characters have a length of 3 to 30 allowed. You can provide ranges of alphabets, numbers and also ranges of ASCII values in the RegEx properties.

Default: [a-zA-Z0-9._-|//]{3,30}$

RolenameJavaScriptRegExRole Name RegEx (Javascript)

The regular expression used by the front-end components for role name validation.

Default: ^[\S]{3,30}$

SCIMEnabledEnable SCIMThis is to configure whether user store is supported for SCIM provisioning.

Possible values:
True : User store support for SCIM provisioning.
False: User does not store support for SCIM provisioning.
BulkImportSupportedBulk Import SupportDefine whether the user store support for bulk user import operation
EmptyRolesAllowedAllow Empty RolesSpecifies whether the underlying user store allows empty groups to be created. In the case of LDAP in Carbon, the schema is modified such that empty groups are allowed to be created. Usually, LDAP servers do not allow you to create empty groups.
PasswordHashMethodPassword Hashing Algorithm

Specifies the Password Hashing Algorithm used the hash the password before storing in the user store.

Possible values:
SHA - Uses SHA digest method. SHA-1, SHA-256
MD5 - Uses MD 5 digest method.
PLAIN_TEXT - Plain text passwords.

If you just configure as SHA, it is considered as SHA-1. It is always better to configure algorithm with higher bit value as digest bit size would be increased.

Most of the LDAP servers (such asOpenLdap, OpenDJ, AD, ApacheDS and etc..) are supported to store passwords as salted hashed values (SSHA). Therefore WSO2 Identity Server just wants to feed password into the connected user store as plain text value. Then LDAP user store be can stored them as salted hashed value. To feed the plain text into the LDAP server, you need to set PasswordHashMethod to “PLAIN_TEXT”

However, if your LDAP does not support to store user password as hashed values. You can configureWSO2server to hash the password and feeds the hashed password into the LDAP server. Then you need to configure PasswordHashMethod property with SHA (SHA-1), SHA-256, SHA-512. Please note WSO2 server cannot create a salted hashed password (SSHA) to feed into the LDAP.

MultiAttributeSeparatorMultiple Attribute SeparatorThis property is used to define a character to separate multiple attributes. This ensures that it will not appear as part of a claim value. Normally “,” is used to separate multiple attributes, but you can define ",,," or "..." or a similar character sequence
Default: “,”
MaxUserNameListLengthMaximum User List Length

Controls the number of users listed in the user store of a WSO2 product. This is useful when you have a large number of users and you do not want to list them all. Setting this property to 0, will display all users.
Default: 100

In some user stores, there are policies to limit the number of records that can be returned from a query. By setting the value to 0, it will list the maximum results returned by the user store. If you need to increase this number, you need to set it in the user store level.

Eg : Active directory has the MaxPageSize property with the default value of 1000.

MaxRoleNameListLengthMaximum Role List Length

Controls the number of roles listed in the user store of a WSO2 product. This is useful when you have a large number of roles and do not want to list them all. Setting this property to 0, displays all roles.

Default: 100

In some user stores, there are policies to limit the number of records that can be returned from a query. By setting the value to 0, it will list the maximum results returned by the user store. If you need to increase this number, you need to set it in the user store level.

Eg : Active directory has the MaxPageSize property with the default value 1000.

kdcEnabledEnable KDC

If your user store is capable of acting as a Kerberos, Key Distribution Center (KDC) and if you like to enable it, set this property to true.

Default: false

UserRolesCacheEnabledEnable User Role CacheThis is to indicate whether to cache the role list of a user.
Default: true

Possible values:
false: Set it to 'false' if the user roles are changed by external means and those changes should be instantly reflected in the Carbon instance.
ConnectionPoolingEnabledEnable LDAP Connection Pooling

Define whether LDAP connection pooling is enabled.

Possible values:
True: Enable connection pooling. Enabling it will improve the performance
False: Disable connection pooling.

LDAPConnectionTimeoutLDAP Connection Timeout

Timeout in making the initial LDAP connection. This is configured in milliseconds.

Default: 5000

ReadTimeoutLDAP Read Timeout

The value of this property is the read timeout in milliseconds for LDAP operations. If the LDAP provider cannot geta LDAPresponse within that period, it aborts the read attempt. The integer should be greater than zero. An integer less than or equal to zero means no read timeout is specified which is equivalent to waiting for the response infinitely until it is received.

Default: 5000

RetryAttemptsRetry Attempts

Retry the authentication request if a timeout happened.

Default: 0

CountRetrieverClassCount Implementation

This define the user / role count retriever implementation class (Only supported for )

Possible values:
JDBC : org.wso2.carbon.identity.user.store.count.jdbc.JDBCUserStoreCountRetriever

java.naming.ldap.attributes.binaryLDAP binary attributesSet the attribute that needs to be stored in the binary format.
Sample values: objectGUID
MembershipAttributeRangeMembership Attribute Range

This is to define the maximum users of role returned by the LDAP/AD user store. This does not depend on the max page size of the user store.

Default: 1500

TenantManager

Define the tenant manager class specific to each user store type. This is only for primary user store manager since its shared among tenants.

JDBC: org.wso2.carbon.user.core.tenant.JDBCTenantManager
LDAP/AD: org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager


Sample configuration for Read-write LDAP user store

 Read-write LDAP sample configuration
<UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadWriteLDAPUserStoreManager">
      <Property name="ConnectionURL">ldap://10.100.1.100:389</Property>
      <Property name="ConnectionName">uid=admin,ou=system</Property>
      <Property encrypted="true" name="ConnectionPassword">kuv2MubUUveMyv6GeHrXr9il59ajJIqUI4eoYHcgGKf/BBFOWn96NTjJQI+wYbWjKW6r79S7L7ZzgYeWx7DlGbff5X3pBN2Gh9yV0BHP1E93QtFqR7uTWi141Tr7V7ZwScwNqJbiNoV+vyLbsqKJE7T3nP8Ih9Y6omygbcLcHzg=</Property>
      <Property name="UserSearchBase">ou=Users,dc=wso2,dc=org</Property>
      <Property name="UserEntryObjectClass">wso2Person</Property>
      <Property name="UserNameAttribute">uid</Property>
      <Property name="UserNameSearchFilter">(&amp;(objectClass=person)(uid=?))</Property>
      <Property name="UserNameListFilter">(objectClass=person)</Property>
      <Property name="UserDNPattern">uid={0},ou=Users,dc=wso2,dc=org</Property>
      <Property name="DisplayNameAttribute"/>
      <Property name="Disabled">false</Property>
      <Property name="ReadGroups">true</Property>
      <Property name="WriteGroups">true</Property>
      <Property name="GroupSearchBase">ou=Groups,dc=wso2,dc=org</Property>
      <Property name="GroupEntryObjectClass">groupOfNames</Property>
      <Property name="GroupNameAttribute">cn</Property>
      <Property name="GroupNameSearchFilter">(&amp;(objectClass=groupOfNames)(cn=?))</Property>
      <Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
      <Property name="RoleDNPattern">cn={0},ou=Groups,dc=wso2,dc=org</Property>
      <Property name="MembershipAttribute">member</Property>
      <Property name="MemberOfAttribute"/>
      <Property name="BackLinksEnabled">false</Property>
      <Property name="UserNameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
      <Property name="UserNameJavaScriptRegEx">^[\S]{3,30}$</Property>
      <Property name="UsernameJavaRegExViolationErrorMsg">Username pattern policy violated.</Property>
      <Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
      <Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
      <Property name="PasswordJavaRegExViolationErrorMsg">Password pattern policy violated.</Property>
      <Property name="RoleNameJavaRegEx">[a-zA-Z0-9._-|//]{3,30}$</Property>
      <Property name="RoleNameJavaScriptRegEx">^[\S]{3,30}$</Property>
      <Property name="SCIMEnabled">true</Property>
      <Property name="BulkImportSupported">true</Property>
      <Property name="EmptyRolesAllowed">true</Property>
      <Property name="PasswordHashMethod">PLAIN_TEXT</Property>
      <Property name="MultiAttributeSeparator">,</Property>
      <Property name="MaxUserNameListLength">100</Property>
      <Property name="MaxRoleNameListLength">100</Property>
      <Property name="kdcEnabled">false</Property>
      <Property name="defaultRealmName">WSO2.ORG</Property>
      <Property name="UserRolesCacheEnabled">true</Property>
      <Property name="ConnectionPoolingEnabled">true</Property>
      <Property name="LDAPConnectionTimeout">5000</Property>
      <Property name="ReadTimeout">5000</Property>
      <Property name="RetryAttempts">0</Property>
      <Property name="CountRetrieverClass"/>
      <Property name="java.naming.ldap.attributes.binary"> </Property>
      <Property name="DomainName">wso2.com.ldap.rw</Property>
      <Property name="Description">Sample read write LDAP user store manager configuration</Property>
</UserStoreManager>