After integrating LDAP, after logging into Sonar, the login name will display a string of numbers

After integrating LDAP, after logging into Sonar, the login name will display a string of numbers. What is the problem?
The LDAP configuration file information is as follows:

The user information displayed in the database is as follows:

After logging in to Sonarqube, the login user information displayed in the login will be accompanied by a string of numbers (may I ask why?):

The configuration of the LDAP server is as follows:

The login name is displayed as follows:
May I ask how to display 5-digit characters as login names?


I must prefix this by saying we aren’t LDAP experts. Our typical advice is to get a 3rd-party LDAP client to work out what your connection settings should be before porting them into SonarQube.

That said, I suspect this is about your ldap.user.baseDn.

If I look in the docs I see two different example values for that setting, both of which use ={login}, so I suspect that whatever’s on the left-hand side of that equals is the LDAP field that will be shown as the SonarQube login.

If I were you, I would start by looking at these users in LDAP to figure out what fields the values that are being used are coming from, and then which fields should be used. And then make sure that field is used in your SonarQube configuration.


The LDAP configuration has been checked and there is no problem. The web log shows that the login name read from LDAP is correct. When inserting into the sonar database, the login name will contain 5 numeric characters



Have you checked the users in LDAP to see where those four digits are coming from? I’m fairly certain we’re not inserting them randomly.


The login name in LDAP is configured like this, using the AD domain


That’s not the question.

I’m 99.9% certain that SonarQube is not pulling those numbers out of the air. When you look at the user directly in LDAP, in what field do those numbers show up?


Hi again,

I might owe you an apology.

What version of SonarQube are you using?



This change was introduced to handle instances connected with multiple LDAP servers, to avoid the risk of misidentification.

You can find the details here.

The change can’t be avoided.


1 Like

The user fields in LDAP are configured through the sAMAAccountName attribute, and login names are all character types without numbers.
The server-side version of Sonarqube is version 10.5.1
The login names configured in the AD domain are as follows:

I have looked at the above link, but I don’t quite understand it. Currently, we only have one ldap server, and the username in ldap is not duplicated. How can we configure sonar to make the login name without numeric characters?


Hi @314205221,

That is not possible anymore. The change applies to all LDAP setup, even for SonarQube instances having a single LDAP connection.