Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

According to the default configuration in WSO2 productsconfigurations in the EI profile, the Users, Roles and Permissions are stored in the same repository (i.e., the default, embedded H2 database). However, you can change this configuration in such a way that the Users and Roles are stored in one repository (User Store) and the Permissions are stored in a separate repository. A user store can be a typical RDBMS, an LDAP or an external Active Directory. For information on how the repositories for storing information about users and roles are configured, see Configuring User Stores .

The repository that stores Permissions should always be an RDBMS. The Authorization Manager configuration in the user-mgt.xml file (stored in the <PRODUCT_HOME>/repository/conf/ directory of the respective profile) connects the system to this RDBMS.

...

  1. Change the default H2 database or set up another RDBMS for storing permissions.
  2. When you set up an RDBMS for your system, it is necessary to create a corresponding datasource, which allows the system to connect to the database. 
    • If you are replacing the default H2 database with a new RDBMS, update the master-datasource.xml file (stored in the <PRODUCT_HOME>/repository/the /conf/datasources/ directory of the EI profile) with the relevant information. 
    • Alternatively, create a new XML file with the datasource information of your new RDBMS and store it in the same <PRODUCT_HOME>/repository/conf/datasources/ directory of the EI profile.

For information on how you can set up a new RDBMS and configure it for your system, see Setting Up the Physical Database, and for information on the purpose of defining datasources and how they are configured for a product, see Managing Datasources.

Step 2: Updating the user realm configurations 

...

Update the datasource information using the <Property> element under <Configuration>. Given below are the properties that are set by default.

Property Name

Description

Mandatory/Optional
dataSource

This is the jndi name of the datasource that is used for referring to the datasource. In the following example, the jndi name of the default datasource defined in the 

<PRODUCT_HOME>/repository

/conf/datasources/master-datasources.xml file is linked from the user-mgt.xml file.

Mandatory
isCascadeDeleteEnabled
This property is set to 'true' by default, which enables cascade delete for the UM_USER_PERMISSION and UM_ROLE_PERMISSION tables when a permission gets deleted from the UM_PERMISSION table. That is, if a record in the parent table is deleted the corresponding records in the child table will be automatically deleted.Mandatory

You can add more optional configurations using the <Property> element:

Property Name

Description

Mandatory/Optional
testOnBorrow

It is recommended to set this property to 'true' so that object connections will be validated before being borrowed from the JDBC pool. For this property to be effective, the validationQuery parameter in the

<PRODUCT_HOME>/repository

/conf/datasources/master-datasources.xml file should be a non-string value. This setting will avoid connection failures. See the section on performance tuning of WSO2 products for more information.

Optional

Configuring the Authorization Manager

...