Unable to login to SonarQube 7.9.1 with LDAP authentication

Hello

Currently I am using SQ 6.7.2 with LDAP authentication. Below are the parameters I have defined in my sonar.properties file.

sonar.security.realm=LDAP
ldap.url=ldap://1x.xx.x.xx:389
ldap.user.baseDn=OU=Global Users,DC=company,DC=com
ldap.bindDn=CN=scm,CN=Users,DC=company,DC=com
ldap.bindPassword=XXXXXXXX
ldap.user.loginAttribute=sAMAccountName
ldap.user.objectClass=user
sonar.authenticator.ignoreStartupFailure=true
sonar.authenticator.createUsers=true

I installed 7.9.1 and have set the folllowing parameters as the above do not work if you just copy them into the new sonar.properties file.

sonar.security.realm=LDAP
ldap.url=ldap://1x.xx.x.xx:389
ldap.bindDn=CN=scm,CN=Users,DC=company,DC=com
ldap.bindPassword=ldap.bindPassword=XXXXXXXX
ldap.user.baseDn=CN=scm,CN=Users,DC=company,DC=com
ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))

When I try to login, it fails and the following is reported in web.log file.

2019.07.10 15:32:01 DEBUG web[AWvdXrrWS2NtOCIYAAAX][o.s.p.l.LdapUsersProvider] Requesting details for user jstanley
2019.07.10 15:32:01 DEBUG web[AWvdXrrWS2NtOCIYAAAX][o.s.p.l.LdapSearch] Search: LdapSearch{baseDn=CN=scm,CN=Users,DC=company,DC=com, scope=subtree, request=(&(objectClass=user)(sAMAccountName={0})), parameters=[jstanley], attributes=[mail, cn]}
2019.07.10 15:32:01 DEBUG web[AWvdXrrWS2NtOCIYAAAX][o.s.p.l.LdapContextFactory] Initializing LDAP context {java.naming.referral=follow, java.naming.security.principal=CN=scm,CN=Users,DC=company,DC=com, com.sun.jndi.ldap.connect.pool=true, java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory, java.naming.provider.url=ldap://1x.xx.x.xx:389, java.naming.security.authentication=simple}
2019.07.10 15:32:01 DEBUG web[AWvdXrrWS2NtOCIYAAAX][o.s.p.l.LdapUsersProvider] User jstanley not found in
2019.07.10 15:32:01 DEBUG web[AWvdXrrWS2NtOCIYAAAX][auth.event] login failure [cause|No user details][method|FORM][provider|REALM|LDAP][IP|10.34.12.36|10.40.11.157][login|jstanley]

Any idea what I need to change to get this to work?

Thanks
Jason

Hello Jason,

It may be a copy-paste error, however, the following line caught my eye:
ldap.bindPassword=ldap.bindPassword=XXXXXXXX

Also, it seems that you have changed the ldap.user.baseDN property. Try changing it to the value in your previous configuration:
ldap.user.baseDn=OU=Global Users,DC=company,DC=com

Hope this helps

2 Likes

Joel

Thanks for the extra set of eyes, I entered the wrong information for the baseDn value.