Unable to retrieve details for user in Sonarqube 8.2 using AD authentication

Hi,

Does anyone have encountered same issue as mine were test LDAP authentication connection went OK but unable to login using the AD credentials.

web.log

2020.05.04 10:12:48 INFO web[org.sonar.INFO] Security realm: LDAP
2020.05.04 10:12:48 INFO web[o.s.a.l.LdapSettingsManager] User mapping: LdapUserMapping{baseDn=cn=users,ou=xx,dc=xxx,dc=xxxxxxxxxx,dc=net, request=(&(objectClass=user)(sAMAccountName={0}), realNameAttribute=cn, emailAttribute=mail}
2020.05.04 10:12:48 INFO web[o.s.a.l.LdapSettingsManager] Group mapping: LdapGroupMapping{baseDn=cn=groups,ou=xx,dc=xxx,dc=xxxxxxxxxx,dc=net, idAttribute=sAMAccountName, requiredUserAttributes=[dn], request=(&(objectClass=group)(member={0}))}
2020.05.04 10:12:48 INFO web[o.s.a.l.LdapContextFactory] Test LDAP connection on ldaps://xx-xxxxx.xxx.xxxxxxxxxx.net:636/ou=users,ou=xx,dc=xxx,dc=xxxxxxxxxx,dc=net?sAMAccountName?sub?&(ObjectClass=user): OK

2020.05.04 10:16:08 ERROR web[AXHddTEHKAMsjsmQAAAf][o.s.s.a.CredentialsExternalAuthentication] Error during authentication
org.sonar.auth.ldap.LdapException: Unable to retrieve details for user jv.ortiz in

sonar.properties

sonar.security.realm=LDAP
ldap.url=ldaps://xx-xxxxx.xxx.xxxxxxxxxx.net:636/ou=users,ou=xx,dc=xxx,dc=xxxxxxxxxx,dc=net?sAMAccountName?sub?&(ObjectClass=user)
ldap.bindDn=xx.xxxxxxxxx.xxx@xxx.xxxxxxxxxx.net
ldap.bindPassword=xxxxxxxxxxxxxxxxxxxx
ldap.authentication=simple
ldap.user.baseDn=cn=users,ou=xx,dc=xxx,dc=xxxxxxxxxx,dc=net
ldap.user.request=(&(objectClass=user)(sAMAccountName={login})
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail
ldap.group.baseDn=cn=groups,ou=xx,dc=xxx,dc=xxxxxxxxxx,dc=net
ldap.group.request=(&(objectClass=group)(member={dn}))
ldap.group.idAttribute=sAMAccountName

Hi,

Have you verified in a standalone LDAP client that the query SonarQube is using does pull up your user? My best first guess here is that while you’re connecting to LDAP just fine, your user query needs tuning.

 
Ann