This page is under construction.
WSO2 products can be configured to authenticate users using their attributes such as email or mobile number instead of the username. This topic provides instructions on how to set up your WSO2 product to authenticate a users by using their email.
The '@' is a special character in WSO2 usernames as it is used in multi-tenant environments to build the users fully-qualified name. For example user suresh from the tenant domain WSO2.com has the fully-qualified name suresh@WSO2.com. So before using email username we need to tell the WSO2 products to not confuse with the '@' symbol in the user's emails. For this we need to do a configuration in the carbon.xml file
- Open the carbon.xml file in the following path:
[PRODUCT_HOME]/repository/conf/carbon.xml
Look for the commented out configuration
EnableEmailUserName
. Uncomment the configuration to enable email authentication.<EnableEmailUserName>true</EnableEmailUserName>
Now the next configuration file we are looking at is the user-mgt.xml which can be found in the path: [PRODUCT_HOME]/repository/conf/user-mgt.xml
You may be connected to an LDAP or Active Directory or maybe to a JDBC-based user store. So regardless of the user store manager being used, focus on the following set of configuration parameters of the user store managers.
Parameter | Description |
---|---|
UserNameAttribute | For this you need to set mail attribute of the user. <Property name="UserNameAttribute">mail</Property> |
UserNameSearchFilter | For this you need to use the mail attribute of the user instead of cn or uid. <property name="UserNameSearchFilter"<(&(objectClass=identityPerson)(mail=?))</property> |
UserNameListFilter | For this you need to use the mail attribute of the user. <property name="UserNameListFilter"<(&(objectClass=identityPerson)(mail=*))</property> |
UsernameJavaRegEx | Use the following email regex. <Property name="UsernameJavaRegEx">^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$</Property> |
UserDNPattern | This parameter is used to speedup the LDAP search operations. You can comment out this config. <!--Property name="UserDNPattern">cn={0},ou=Users,dc=wso2,dc=com</Property--> |
Realm configurations | The <AdminUser> <UserName>admin@wso2.com</UserName> <Password>admin</Password> </AdminUser> |