If the directory/file paths specified in this guide do not exist in your WSO2 product, see Directory Structure of WSO2 Products to locate the paths applicable to your product.

Versions Compared

Key

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

...

Adding a new user and assigning roles roles

Note

Add the GetRoleListOfInternalUserSQL property within the <Realm> section in the <PRODUCT_HOME>/repository/conf/user-mgt.xml  file as shown below, to avoid case sensitivity issues when creating users.

Code Block
languagexml
<Realm>
<Configuration>
<Property name="GetRoleListOfInternalUserSQL">SELECT UM_ROLE_NAME FROM UM_HYBRID_USER_ROLE, UM_HYBRID_ROLE WHERE UPPER(UM_USER_NAME)=UPPER ( ? ) AND UM_HYBRID_USER_ROLE.UM_ROLE_ID=UM_HYBRID_ROLE.UM_ID AND UM_HYBRID_USER_ROLE.UM_TENANT_ID=? AND UM_HYBRID_ROLE.UM_TENANT_ID=? AND UM_HYBRID_USER_ROLE.UM_DOMAIN_ID=(SELECT UM_DOMAIN_ID FROM UM_DOMAIN WHERE UM_TENANT_ID=? AND UM_DOMAIN_NAME=?)</Property>
</Configuration>
</Realm>

...

Code Block
UserName,password,roleuser1,password123, role=admin:developer
user2,password123, role=admin:tester
user3,password123, role=admin:developer:tester
user4,password123, role=devops
user5,password123, role=devops:tester
Note

Make sure you have the roles that you assign to the users available in the system. If not, the server will throw an error. See Configuring Roles for information on adding user roles to the server.

In addition to importing users with their passwords and roles, you can import other user attributes such as email addressfull namelast name, mobile, and given name only if  given name etc. using claim URls that are defined for such attributes in the product. Here's an example of claim URls that you can defined for your product:

...