This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Using Email Address as the Username
WSO2 products can be configured to authenticate users using their attributes. For example, these attributes can be email or mobile number instead of the username. If your organization decide to use users email as their username, this topic provides instructions on how to set up your WSO2 product to authenticate users using their email.
'@' is a special character in WSO2 products, since its used to differentiate username from tenant domain, in multi-tenant environments. For example, user Daniel from the tenant domain WSO2.com has the fully-qualified name daniel@WSO2.com. So, before using the email username we need to configure the WSO2 products to differentiate between the '@' symbol in the user's emails and tenant domain separator. Do the following to configure this.
Configuring email as user in already running Identity Server is not the production recommended way.
Open the <
PRODUCT_HOME>/repository/conf/carbon.xmlfile.Look for the commented out configuration
EnableEmailUserName. Uncomment the configuration to enable email authentication.<EnableEmailUserName>true</EnableEmailUserName>Open the
<IS_HOME>/repository/conf/identity/identity-mgt.propertiesfile and set the following property totrue.UserInfoRecovery.UseHashedUserNames=trueOptionally, you can also configure the following property to determine which hash algorithm to use.
UserInfoRecovery.UsernameHashAlg=SHA-1Open the <
PRODUCT_HOME>/repository/conf/user-mgt.xmlfile and add the following property under the relevant user store manager tag, such asReadWriteLDAPUserStoreManager,ActiveDirectoryUserStoreManageror any other user store manager tag.
This property determines the username validation that will be enforced when theEnableEmailUserNameoption is enabled.<Property name="UsernameWithEmailJavaScriptRegEx">^[\S]{3,30}$</Property>Configure the following set of parameters in the user store configuration, depending on the type of user store you are connected to (LDAP/Active Directory/JDBC).
Restart the server.
For more information on how to configure primary and secondary user stores, see Configuring User Stores.