SonarQube LDAP couldn't find user

  • SonarQube Information:
    – Version: Developer Edition

Hello, we are trying to enable LDAP with Active Directory in our SonarQube developer edition.
These are our current config****



Since we are using ldaps protocol, we have registered the certificate in our java trust store.

The LDAP connection is OK, but the problem is we are not able to log in because the user is not found.

We have tried to log in with these combinations

  • org/username
  • username

This is the logs

2022.07.11 11:30:39 DEBUG web[AYHrTq6qldIUpIRUAAAG][o.s.a.l.LdapUsersProvider] Requesting details for user tony_stark
2022.07.11 11:30:39 DEBUG web[AYHrTq6qldIUpIRUAAAG][o.s.a.l.LdapSearch] Search: LdapSearch{baseDn=OU=****,DC=****,DC=****, scope=subtree, request=(&(objectClass=user)(sAMAccountName={0})), parameters=[tony_stark], attributes=[mail, cn]}
2022.07.11 11:30:39 DEBUG web[AYHrTq6qldIUpIRUAAAG][o.s.a.l.LdapContextFactory] Initializing LDAP context {java.naming.referral=follow,****,OU=****,OU=****,DC=****,DC=****, com.sun.jndi.ldap.connect.pool=true, java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory, java.naming.provider.url=ldaps://****.****.****:3269,}
2022.07.11 11:30:39 DEBUG web[AYHrTq6qldIUpIRUAAAG][]  TLSHandshake: ****.****.****:3269, TLSv1.2, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, -131930106
2022.07.11 11:30:39 DEBUG web[AYHrTq6qldIUpIRUAAAG][o.s.a.l.LdapUsersProvider] User tony_stark not found in <default>
2022.07.11 11:30:39 DEBUG web[AYHrTq6qldIUpIRUAAAG][auth.event] login failure [cause|No user details][method|FORM][provider|REALM|LDAP][IP|0:0:0:0:0:0:0:1|][login|tony_stark]

Any idea how to solve it?

Hey there.

Our implementation of LDAP is not particularly complex :slight_smile: It takes the configuration that you set and effectively performs an ldapsearch to get information from the LDAP server. This means you can debug the values you’ve passed to SonarQube just by running ldapsearch in a Unix environment.

Thank you so much @Colin, I am able to debug it with the ldapsearch. It seems I need to use specific DN in ldap.user.request to make it works.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.