LDAP login with username either userPrincipalName or sAMAccountName?

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

This widget could not be displayed.

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
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

270 views 2 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you