Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

LDAP login with username either userPrincipalName or sAMAccountName?

Alan Sparks August 3, 2011

Isd it possible to configure an LDAP (MS AD) directory that will allow a user to log in using either the LDAP directories' userPrincipalName or sAMAccountName attrribute value? I'd like to allow people to use either (the one is older and more familiar to my audience than the other). Or is it only possible to match on a single attribute for a login username?

Thanks.

-Alan

1 answer

0 votes
justindowning
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2011

You can setup multiple LDAP repositories in Confluence. In 3.4.x and earlier, just edit atlassian-user.xml and input to repositories with different usernameAttribute elements:

<ldap key="ad1" name="ad1" cache="true">
        <host>ad1</host>
        <port>389</port>
        <securityProtocol>plain</securityProtocol>
        <securityAuthentication>simple</securityAuthentication>
        <usernameAttribute>sAMAccountName</usernameAttribute>
        <userSearchFilter>(objectClass=user)</userSearchFilter>
        <firstnameAttribute>givenname</firstnameAttribute>
        <surnameAttribute>sn</surnameAttribute>
        <emailAttribute>mail</emailAttribute>
        <groupnameAttribute>cn</groupnameAttribute>
        <groupSearchFilter>(objectClass=group)</groupSearchFilter>
        <userSearchAllDepths>true</userSearchAllDepths>
        <groupSearchAllDepths>true</groupSearchAllDepths>
        <membershipAttribute>member</membershipAttribute>
</ldap>
<ldap key="ad2" name="ad2" cache="true">
        <host>ad2</host>
        <port>389</port>
        <securityProtocol>plain</securityProtocol>
        <securityAuthentication>simple</securityAuthentication>
        <usernameAttribute>userPrincipalName</usernameAttribute>
        <userSearchFilter>(objectClass=user)</userSearchFilter>
        <firstnameAttribute>givenname</firstnameAttribute>
        <surnameAttribute>sn</surnameAttribute>
        <emailAttribute>mail</emailAttribute>
        <groupnameAttribute>cn</groupnameAttribute>
        <groupSearchFilter>(objectClass=group)</groupSearchFilter>
        <userSearchAllDepths>true</userSearchAllDepths>
        <groupSearchAllDepths>true</groupSearchAllDepths>
        <membershipAttribute>member</membershipAttribute>
</ldap>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events