Make sure to tell us:
- What version are you upgrading from?
SonarQube 8.9 developer - System information (Operating system, Java version, Database provider/version)
k8s 1.24.6 - Java 17.0.9 - external AWS PostgreSQL - What’s the issue you’re facing?
The connection to the LDAP server is ok but then I cannot log in with the Active Directory users.
2024.01.29 12:40:28 INFO web[][o.s.a.l.LdapSettingsManager] User mapping: LdapUserMapping{baseDn=DC=local,DC=domain,DC=my, request=(userPrincipalName={0}), realNameAttribute=displayname, emailAttribute=mail}
2024.01.29 12:40:28 INFO web[][o.s.a.l.LdapSettingsManager] Group mapping: LdapGroupMapping{baseDn=DC=local,DC=domain,DC=my, idAttribute=sAMAccountName, requiredUserAttributes=[dn], request=(&(objectClass=group)(member={0}))}
2024.01.29 12:40:28 INFO web[][o.s.a.l.LdapContextFactory] Test LDAP connection on ldap://my.domain.local: OK
Error:
2024.01.29 12:42:23 DEBUG web[AY1VPI6KSmO5XvMDAAA9][o.s.a.l.LdapSearch] Search: LdapSearch{baseDn=DC=local,DC=domain,DC=my, scope=subtree, request=(userPrincipalName={0}), parameters=[johndoe@mydomain.com], attributes=null}
2024.01.29 12:42:23 DEBUG web[AY1VPI6KSmO5XvMDAAA9][o.s.a.l.LdapContextFactory] Initializing LDAP context {java.naming.referral=follow, java.naming.security.principal=CN=ldapuser,OU=IT,DC=local,DC=domain,DC=my, com.sun.jndi.ldap.connect.pool=true, java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory, java.naming.provider.url=ldap://mydoamin.com, java.naming.security.authentication=simple}
2024.01.29 12:42:23 DEBUG web[AY1VPI6KSmO5XvMDAAA9][o.s.a.l.DefaultLdapAuthenticator] User johndoe@mydomain.com not found in server <default>: javax.naming.NamingException: [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C090CF4, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v4563]; remaining name 'DC=local,DC=domain,DC=my'
2024.01.29 12:42:23 DEBUG web[AY1VPI6KSmO5XvMDAAA9][o.s.a.l.DefaultLdapAuthenticator] User johndoe@mydomain.com not found
2024.01.29 12:42:23 DEBUG web[AY1VPI6KSmO5XvMDAAA9][auth.event] login failure [cause|Realm returned authenticate=false][method|FORM][provider|REALM|ldap][IP|172.16.18.26|172.16.98.64][login|johndoe@mydomain.com]
Same configuration works Ok for version 8.9:
sonarProperties:
ldap.user.realNameAttribute: displayname
sonar.authenticator.downcase: true
sonar.security.realm: LDAP
ldap.url: ldap://mydoamin.com
ldap.bindDn: CN=ldapuser,OU=IT,DC=local,DC=domain,DC=my
ldap.group.baseDn: DC=local,DC=domain,DC=my
ldap.user.baseDn: DC=local,DC=domain,DC=my
ldap.user.request: (userPrincipalName={login})
ldap.group.request: (&(objectClass=group)(member={dn}))
ldap.group.idAttribute: sAMAccountName
env:
- name: ldap.bindPassword
valueFrom:
secretKeyRef:
name: ldap-password
key: ldap-bindpassword
What could I do to authenticate with my LDAP server as I did with version 8.9?
Thank you.