...
Follow the procedure below to share a user store between WSO2 DAS and WSO2 IS.
- Create new a new database named
DAS_UM_DB
in in the MYSQL server. - Create tables inside the created database by executing the script in the
<DAS_HOME>/dbscripts/mysql.sql
. Define a datasource as follows in the
<DAS_HOME>/repository/conf/datasources/master-datasources.xml
file. This allows you to connect to theDAS_UM_DB
in order to share the user store.Code Block language xml <datasource> <name>WSO2UM_DB</name> <description>The datasource used for user manager database</description> <jndiConfig> <name>jdbc/WSO2UM_DB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://localhost:3306/APPMDAS_UM_DB</url> <username>username</username> <password>password</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource>
- Add the same datasource configuration given in the previous step to the
<IS_HOME>/repository/conf/datasources/master-datasources.xml
file. - Download the MySQL database driver from here and copy it to both
<IS_HOME>/repository/components/lib
and<DAS_HOME>/repository/components/lib
directories. Update the
<DAS_HOME>/repository/conf/user-mgt.xml
file with thejndiConfig
name added in step3 (i.e.,jdbc/WSO2UM_DB
) as shown below. Do the same update in the<IS_HOME>/repository/conf/user-mgt.xml
file.Code Block language xml <configuration> ... <Property name="dataSource">jdbc/WSO2UM_DB</Property> </configuration>
Copy the following JDBC user store configuration that can be found in the
<DAS_HOME>/repository/conf/user-mgt.xml
file to the<IS_HOME>/repository/conf/user-mgt.xml
file. Remove the LDAP user store configuration available by default in the<IS_HOME>/repository/conf/user-mgt.xml
file.Code Block language xml <UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager"> <Property name="TenantManager">org.wso2.carbon.user.core.tenant.JDBCTenantManager</Property> <Property name="ReadOnly">false</Property> <Property name="ReadGroups">true</Property> <Property name="WriteGroups">true</Property> <Property name="UsernameJavaRegEx">^[\S]{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 length should be within 5 to 30 characters</Property> <Property name="RolenameJavaRegEx">^[\S]{3,30}$</Property> <Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property> <Property name="CaseInsensitiveUsername">true</Property> <Property name="SCIMEnabled">false</Property> <Property name="IsBulkImportSupported">true</Property> <Property name="PasswordDigest">SHA-256</Property> <Property name="StoreSaltedPassword">true</Property> <Property name="MultiAttributeSeparator">,</Property> <Property name="MaxUserNameListLength">100</Property> <Property name="MaxRoleNameListLength">100</Property> <Property name="UserRolesCacheEnabled">true</Property> <Property name="UserNameUniqueAcrossTenants">false</Property> </UserStoreManage
- Restart both WSO2 DAS and WSO2 IS servers.
...
- Create a new database named
DAS_REG_DB
in the MySQL server. - Create tables in the database you created by executing the script in the
<DAS_HOME>/dbscripts/mysql.sql
directory. Define a datasource as follows in the
<DAS_HOME>/repository/conf/datasources/master-datasources.xml
file. This allows you to connect to theDAS_REG_DB
that you previously created.Code Block language xml <datasource> <name>WSO2REG_DB</name> <description>The datasource used for registry database</description> <jndiConfig> <name>jdbc/WSO2REG_DB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <url>jdbc:mysql://localhost:3306/APPMDAS_REG_DB</url> <username>username</username> <password>password</password> <driverClassName>com.mysql.jdbc.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource>
- Add the same datasource configuration provided in the above step to the
<IS_HOME>/repository/conf/datasources/master-datasources.xml
file. - Download the MySQL database driver from here and copy it to both
<IS_HOME>/repository/components/lib
and<DAS_HOME>/repository/components/lib
directories. Create the registry mounts by adding the following configuration to both the
<DAS_HOME>/repository/conf/registry.xml
file and the<IS_HOME>/repository/conf/registry.xml
file.Code Block <dbConfig name="govregistry"> <dataSource>jdbc/WSO2REG_DB</dataSource> </dbConfig> <remoteInstance url="https://localhost"> <id>gov</id> <dbConfig>govregistry</dbConfig> <readOnly>false</readOnly> <enableCache>true</enableCache> <registryRoot>/</registryRoot> </remoteInstance> <mount path="/_system/governance" overwrite="true"> <instanceId>gov</instanceId> <targetPath>/_system/governance</targetPath> </mount> <mount path="/_system/config" overwrite="true"> <instanceId>gov</instanceId> <targetPath>/_system/config</targetPath> </mount>
- Restart both the WSO2 DAS server and the WSO2 IS server.
...