This documentation is for WSO2 Identity Server 5.0.0. View documentation for the latest release.
Authentication using Attributes - Identity Server 5.0.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

In a user store, each user has different attributes such as uid, cn, email and so on. Some of the attributes can be unique. As an example, normally uid and mail can be unique attributes for user.

Once you connect your LDAP with an application, the application can use one of the unique attributes in LDAP to authenticate the user (as the user name of the user in that application). Considering our example, it can be the uid or mail attribute. Additionally, in some cases, the application can use both attributes. So end users can be authenticated in the application using both their uid or mail.

WSO2 Identity Server can be deployed with any LDAP based server and it can expose authentication via a Web Service API, SAML, OAuth, OpenID, etc. By default, Identity Server is configured to authenticate with only one user attribute in the LDAP. This topic provides instructions on how the Identity Server can be extended to authenticate users using more than one attribute.

For the purposes of this example, we assume that users need to be authenticated using both their uid and mail attributes in the LDAP.

  1. Configure the LDAP user store related configurations using the user-mgt.xml file found in the <IS_HOME>/repository/conf directory. See here for more information on configuring user stores.
    1. Configure UserNameSearchFilter that helps to search for the user object in the LDAP using both mail and uid attributes.
      <Property name="UserNameSearchFilter">(&amp;(objectClass=person)(|(mail=?)(uid=?)))</Property> 
    2. Disable UserDNPattern property, if it is currently enabled.
      <!--Property name="UserDNPattern">uid={0},ou=Users,dc=wso2,dc=org</Property--> 
    3. The mail attribute has requirements that are unique. If you are using the mail attribute, you need to open the carbon.xml file found in the <IS_HOME>/repository/conf directory and uncomment the following. See here for more information on email authentication.
      <EnableEmailUserName>true</EnableEmailUserName> 
  2. If you want to work with multiple attributes (basically to retrieve internal roles with multiple attributes), you must add following property in the <IS_HOME>/repository/conf/user-mgt.xml file. This can be done only once you have installed the WSO2 Identity Server 5.0.0 along with the Service Pack
    <Property name="MultipleAttributeEnable">true</Property>

  3. To test this, restart the Identity Server and try to log in to the management console by providing both the mail and uid with the same password.
  • No labels