LDAP Case Sensitivity Config Breaks Login

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!


Version: SonarQube Server - Enterprise Build 2025.1 LTA

Deployment method: Helm

What are you trying to achieve?/What have you tried so far to achieve this?

Attempting to set sonar.authenticator.downcase to True breaks LDAP login.

Confirmed that our LDAP server is set to be case-insensitive.

Found this related ticket: LDAP case sensitivity bug

We do not have LDAP group membership configured for SonarQube however.

What are we missing in terms of configuration or could this possibly be a genuine bug?

Also, when sonar.authenticator.downcase is set to true, does SonarQube automatically lowercase other LDAP-related values, such as group names or search attributes?

Thank you!

Hey there

When you say “breaks LDAP login” – what do you mean? More specifically – can new users login, but existing users with non-lowercase user IDs (on SonarQube) can’t?

Hey Colin, so sorry for the lag in getting back - just got the chance to circle back to this issue.

To help clarify - after adding the downcase configuration, we noticed that all attempts to log in to the server failed.

We have to remove the downcase configuration from the server configs and redeploy the server in order to be able to log in again.

This is for all existing users. For new users, do you mean testing adding a new user to SonarQube that isn’t authenticated through the LDAP server?

Hey @Alexandra

No worries.

What I’m trying to get at is – if all your users should now have a lowercase username, you are going to update the existing users to also have a lowercase uesrname, either using PATCH /api/v2/users-management/users/{id} or (more simply, but deprecated) POST api/projects/update_login.

To clarify, I’m confirming whether a new user logging into SonarQube for the first time is successful. If the login works, then your login system is functioning correctly, and you just need to update the existing logins as I previously mentioned. This is just to ensure we’re addressing the real problem. :slight_smile:

Hey Colin, thanks for the info/clarification! This work has just resurfaced for us. I haven’t been able to confirm a successful login for a new LDAP-synced user, but I have confirmed that new local (non-LDAP) user logins work correctly when sonar.authenticator.downcase=true is enabled.

I also ran some local tests to try setting usernames to lowercase as you suggested, but I’m running into what seem to be syntax errors

Does this syntax look correct for updating the user’s login?
curl -v -X PATCH "https://<domain>/api/v2/users-management/users/<user-id>" \ -H "Accept: application/json, text/plain, */*" \ -H "Content-Type: application/merge-patch+json" \ -u <token>: \ --data '{"login":{"value":"updated-name","defined":true}}'

The request works for updating other user fields (like name), but fails when I try to update the login.

Hey @Alexandra

Just tried it out myself. I think we have a docs issue. This curl command, where just a string is defined as login (no value or defined attributes) worked perfectly.

curl -v -X PATCH "https://<domain>/api/v2/users-management/users/<user-id>" \
  -H "Accept: application/json, text/plain, */*" \
  -H "Content-Type: application/merge-patch+json" \
  -u <token>: \
  -d '{"login": "updated-name"}'

Will flag this for the team. Let me know if it works for you.

@Colin Thanks that worked! Though it seems updating the login to all lowercase does not prevent the failed login for an LDAP-synced account when the username is set to all lowercase and sonar.authenticator.downcase=True.

I noticed there’s an externalLogin field that I could try updating, but would modifying it break the synchronization between SonarQube and the LDAP service?

Looking at the options available to you in the Web API Docs:

  • login is SonarQube’s internal user value; it doesn’t necessarily sync with LDAP and is only used within SonarQube.
  • externalId is typically unique to integrations with DevOps platforms (like Azure DevOps or GitHub).
  • externalLogin should align with the identifier used in LDAP. If your LDAP server is case-insensitive, changing the case won’t cause problems.

So I think updating externalLogin is the way to go.

Before making any changes in production, I suggest test these adjustments with a single user or on a non-production environment to ensure everything works as expected.