Hello,
While currently using version 10.8 EE were working on upgrading toward the newer 2025 version of SonarQube.
One of the actions we need to perform to update our authentication.
In the config file we enabled SSO header authentication.
For a new account it is working as expected, for existing accounts however we get “This account is already associated with another authentication method.”
On the test user we notice that the ExternalProvider was set to sonarqube, where existing accounts are set to aad.
While we tried to change the newExternalProvider=sonarqube, the account is set to LDAP_Default
We used the following two options; were we think the API v2 is the way to go.
- curl -X POST -u TOKEN: http://localhost:9000/api/users/update_identity_provider?login=&newExternalIdentity=&newExternalProvider=sonarqube
- curl -X PATCH -u TOKEN: http://localhost:9000/api/v2/users-management/users/[ID]?newExternalProvider=sonarqube
We can’t set the newExternalProvider=sonarqube, however, as we get “ {“message”:“Unsupported media type.”} ” as error.
While using
- curl -X PATCH -u <USER_TOKEN>: http://localhost:9000/api/v2/users-management/users/ -H “Content-Type: application/merge-patch+json” {“externalProvider”: “sonarqube”, “externalLogin”: “”, “externalId”: “”}
we get:
- {“message”:“Invalid request format.”}curl: (3) unmatched brace in URL position 2:
'{externalProvider:
^
To us it looks like the externalProvider is not available to set, but a new user is getting this value set however upon a successful login.
Any hints are welcome here,
Thanks in advance,
Bas
Already one other question, any option do this as a mass action on all existing accounts?
We can get all ID’s using “curl -X GET -u TOKEN: http://localhost:9000/api/v2/users-management/users” but then we need to perform a lot of manual action to set the provider on each account.