This documentation is for WSO2 Identity Server 5.1.0 . View documentation for the latest release.

Versions Compared

Key

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

...

  1. Open the carbon.xml file in the following path: [PRODUCT_HOME]/repository/conf/carbon.xml
  2. Look for the commented out configuration EnableEmailUserName. Uncomment the configuration to enable email authentication.

    Code Block
    languagehtml/xml
    <EnableEmailUserName>true</EnableEmailUserName>
  3. Open the user-mgt.xml file found in the [PRODUCT_HOME]/repository/conf/ directory and add the following property under the relevant user store manager tag. . This property determines the username validation that will be enforced when the EnableEmailUserName option is enabled. 

    Info

    The user-mgt.xml file consists of configurations for the primary user store. If you are trying to configure this for a secondary user store, modify the relevant user store configuration file found in the [PRODUCT_HOME]/repository/deployment/server/userstores directory instead.

    Code Block
    languagexml
    <Property name="UsernameWithEmailJavaScriptRegEx">^[\S]{3,30}$</Property>
  4. Configure the following set of parameters in the user-mgt.xml file under the relevant user store manager tag, depending on the type of user store you are connected to (LDAP/Active Directory/ JDBC).

    Note

    Note: These properties have not been added by default for the JDBCUserStoreManager. Therefore, if you are using a JDBC-based user store, add the properties marked with an asterisk * to the user-mgt.xml file under the relevant user store manager tag. For any other type of user store, simply modify the values of all the properties listed below.

    ParameterDescription

    UserNameAttribute


    For this you need to set mail attribute of the user.

    Code Block
    languagehtml/xml
    <Property name="UserNameAttribute">mail</Property>
    UserNameSearchFilter

    For this you need to use the mail attribute of the user instead of cn or uid.

    Code Block
    languagehtml/xml
    <Property name="UserNameSearchFilter">(&amp;(objectClass=identityPerson)(mail=?))</Property>
    UserNameListFilter

    For this you need to use the mail attribute of the user.

    Code Block
    languagehtml/xml
    <Property name="UserNameListFilter">(&amp;(objectClass=identityPerson)(mail=*))</Property>
    UserDNPattern

    This parameter is used to speedup the LDAP search operations. You can comment out this config.

    Code Block
    languagehtml/xml
    <!--Property name="UserDNPattern">cn={0},ou=Users,dc=wso2,dc=com</Property-->
    UsernameJavaScriptRegEx

    * (This property is relevant to JDBCUserStoreManager)

    Change this property under the relevant user store manager tag as follows. This property allows you to add special characters like "@" in the user name.

    Code Block
    languagexml
    <Property name="UsernameJavaScriptRegEx">^[a-zA-Z0-9._-][email protected][a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$</Property>
    Realm configurations

    The AdminUser username should use the email attribute of the admin user.

    Code Block
    languagehtml/xml
    <AdminUser>
             <UserName>[email protected]</UserName>
             <Password>admin</Password>
    </AdminUser>
  5. Restart the server.

Panel
titleRelated Topics

See Configuring User Stores for more information on how to configure primary and secondary user stores.