Using Email Address as the Username¶
Configuring the email address as the username in an already running Identity Server is not the production recommended way. Therefore, make sure to configure it before you begin working with WSO2 IS.
- Open the
Add the following configuration.
[tenant_mgt] enable_email_domain= true
Login to the management console and configure the
Mapped Attributeproperty of the
http://wso2.org/claims/usernameclaim ID that is under Dialect dialectURI
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).
Set the mail attribute of the user. LDAP/Active Directory only
Use the mail attribute of the user instead of
uid. LDAP/Active Directory only
Use the mail attribute of the user if necessary. LDAP/Active Directory only
Change this property that is under the relevant user store manager tag as follows. This property allows you to add special characters like "@" in the username.
This is a regular expression to validate usernames. By default, strings have a length of 5 to 30. Only non-empty characters are allowed. You can provide ranges of alphabets, numbers and also ranges of ASCII values in the RegEx properties.
The username must use the email attribute of the admin user.
Before this configuration, the user having the username admin and password admin was considered the super administrator. The super administrator user cannot be deleted.
After this configuration, the user having the username
firstname.lastname@example.org considered the super administrator. The user having the username admin is considered as a normal administrator.
With these configuration users can log in to super tenant with both email user name (
email@example.com) or non-email user names (
larry). But for tenant only email user names allowed (
You can configure email user name without enabling
enable_email_domainproperty, then users can login to both super tenant and tenant using email and non-email user names. But super tenant users should always use @carbon.super at the end of user names.
Restart the server.
For more information on how to configure primary and secondary user stores, see Configuring User Stores.