# LDAP Case Sensitivity Config Breaks Login

**URL:** <https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918>\
**Category:** SonarQube Server / Community Build\
**Tags:** authentication, ldap, sonarqube\
**Created:** [March 27, 2025, 6:41pm UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918 "2025-03-27T18:41:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.sonarsource.com/u/Alexandra)\
**Post date:** [March 27, 2025, 6:41pm UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/1 "2025-03-27T18:41:59Z")

</div>

Must-share information (formatted with [Markdown](https://commonmark.org/help/)):

- 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](https://community.sonarsource.com/t/ldap-case-sensitivity-bug/29601)

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!

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [March 28, 2025, 1:46pm UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/2 "2025-03-28T13:46:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.sonarsource.com/u/Alexandra)\
**Post date:** [April 4, 2025, 12:14am UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/3 "2025-04-04T00:14:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [April 4, 2025, 4:17pm UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/4 "2025-04-04T16:17:13Z")

</div>

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}**](https://next.sonarqube.com/sonarqube/web_api_v2#/users-management/users/%7Bid%7D--patch) or (more simply, but deprecated) [**POST api/projects/update\_login**](https://next.sonarqube.com/sonarqube/web_api/api/users/update_login?deprecated=true).

> [@LDAP Connection Failed](https://community.sonarsource.com/t/ldap-connection-failed/67864/14):
>
> Hey @vishwanihar and @shiva_sq When connecting SonarQube to a case-insensitive LDAP setup, you should set the sonar.authenticator.downcase=true configuration in your $SONARQUBE\_HOME/conf/sonar.properties file and restart your SonarQube server. While not available through the UI, the POST api/users/update\_login Web API (documentation linked in the footer of your instance) can be used to rename the logins of existing users so that duplicates aren’t made. You can imagine a script that programmat…

> [@Alexandra](#):
>
> 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?

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. 🙂

---

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.sonarsource.com/u/Alexandra)\
**Post date:** [June 30, 2025, 6:33pm UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/5 "2025-06-30T18:33:08Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [July 1, 2025, 9:02am UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/6 "2025-07-01T09:02:01Z")

</div>

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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![Alexandra](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Alexandra](https://community.sonarsource.com/u/Alexandra)\
**Post date:** [July 1, 2025, 5:56pm UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/8 "2025-07-01T17:56:14Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [July 2, 2025, 7:54am UTC](https://community.sonarsource.com/t/ldap-case-sensitivity-config-breaks-login/137918/9 "2025-07-02T07:54:47Z")

</div>

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.
