Must-share information (formatted with Markdown):
- Version: sonarqube-2025.1.2.108896
- Sonarqube Server / Community Build
- deployed via zip
- attempted to change the username for an employee
- used API: /api/v2/users-management/users/{id}
used the API endpoint to change the username from Bob to Mary (example). Sample JSON payload:
{
"login": "mmai",
"name": "Mary Mai",
"email": "mmai@domain.com",
"active": true,
"local": true
}
While the API does return, it resets the local to false:
{
"id": "AXzcuII_hHToUQOqGHLb",
"login": "mmai",
"name": "Mary Mai",
"email": "mmai@domain.com",
"active": true,
"local": false,
"managed": false,
"externalLogin": "mmai",
"externalProvider": "sonarqube",
"externalId": "mmai",
"avatar": "e9a5f50b0db23a2ec0b18d3193f474d7",
"sonarQubeLastConnectionDate": "2026-06-03T20:35:57+0000",
"sonarLintLastConnectionDate": "2026-06-03T20:35:57+0000",
"scmAccounts": []
}
access log entry:
192.168.7.15 - - \[19/Jun/2026:21:15:25 +0000\] "PATCH /api/v2/users-management/users/AXzcuII_hHToUQOqGHLb HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36" "f04d7afb-edfc-4bfb-8c28-b49f4bb86e4b"
Notice the local value changes from true to false. Now the user cannot sign in and I can no longer manage the user from the web UI. subsequent attempts to reset the password via the api fails as well:
{"result":"Password cannot be changed when external authentication is used"}
I suspect that the first time I attempted to change the user’s login name, I didn’t specify that the local was set to true and it’s been set to false. Now I cannot set it to true.
How can I restore this user to locally/internally managed?