Wednesday, February 13, 2013

How to make login(user name) case insensitive in WSO2 Governance Registry.


WSO2 Governance Registry is shipped with the JDBC based user store manager. The default queries that are used in user management bundle(to handle the user name) is case sensitive. You can convert those queries to case insensitive manner and override the default queries .

To make the user name case insensitive:

Environments : G-Reg 4.5.3, JDK 1.6, MySql(or Oracle)

1) Download the latest G-Reg (4.5.3) and configure with MySQL or Oracle database.

2) Open the user-mgt.xml file, which is reside the wso2greg-4.5.3/repository/conf

2) Add the following two queries in user-mgt.xml  as properties  in <UserStoreManager>  configuration.

<Property name="UserFilterSQL">SELECT UM_USER_NAME FROM UM_USER WHERE UPPER(UM_USER_NAME) LIKE UPPER(?) AND UM_TENANT_ID=? ORDER BY UM_USER_NAME</Property> 

<Property name="UserRoleSQL">SELECT UM_ROLE_NAME FROM UM_USER_ROLE, UM_ROLE, UM_USER WHERE UPPER(UM_USER.UM_USER_NAME)=UPPER(?) AND UM_USER.UM_ID=UM_USER_ROLE.UM_USER_ID AND UM_ROLE.UM_ID=UM_USER_ROLE.UM_ROLE_ID AND UM_USER_ROLE.UM_TENANT_ID=? AND UM_ROLE.UM_TENANT_ID=? AND UM_USER.UM_TENANT_ID=?</Property>

Now you should be able to login to G-Reg server as AdMiN.