The default JDBC user store reads/writes into the internal database of the Carbon server. Internal JDBC user stores can be configured using
<PRODUCT_HOME>/repository/conf/user-mgt.xml file's JDBCUserStoreManager configuration section.
The default configuration is shown below. Change the values according to your requirements.
The main elements of the above configuration are described below.
|TenantManager||Includes the location of the tenant manager.|
|Indicates whether the user store of this realm operates in the user read only mode or not.|
|Maximum number of users retrieved at once by user real.|
|Indicates whether Email is used as user name (apply when realm operates in read only mode).|
|Can be either default or custom (apply when realm operates in read only mode).|
Digesting algorithm of the password. Has values such as PLAIN_TEXT, SHA etc.
Indicates whether to salt the password.
An attribute used for multi-tenancy.
A regular expression to validate passwords. By default, strings having length 5 to 30 non-empty characters are allowed.
|The regular expression used by the font-end components for password validation.|
|A regular expression to validate usernames. By default, strings having length 5 to 30 non-empty characters are allowed.|
|A regular expression to validate rolenames. By default, strings having length 5 to 30 non-empty characters are allowed.|
|The regular expression used by the font-end components for rolename validation.|
This is to indicate whether to cache the role list of a user. By default it is 'true'. Set it to 'false' if user-roles are changed by external means and those changes should be instantly reflected in the carbon instance.
In addition to the above properties, set the following also in
MultiTenantRealmConfigBuilder property should be set to
org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder. For example:
This property is described in section Realm Configuration.
Add a property by the name passwordHashMethod to JDBCUserStoreManager default configuration shown above and set the value to SHA or PLAIN_TEXT. For example:
<PRODUCT_HOME>/repository/conf/tenant-mgt.xmlfile and comment out the CommonHybridLDAPTenantManager, which is used by default and uncomment JDBCTenantManager. For example: