Attempting to create users prior to them logging in so we can automate assigning permissions. At first we tried the api to create a user as local false then login with aad for that same user. What ended up happening is the database got two entries for the same user so that was a fail. Then we tried creating the user and specifying the externalProvider as aad, but the api ignores the value. Then we tried creating the user as local false, then calling the update_identity_provider for the user. That resulted in the error below. We do not use the LDAP plugin, only the AAD plugin as it is more secure. It seems SonarQube tries to get in the way of creating a user before they login with the external provider which really should not be a requirement. Can someone help?
Template for a good bug report, formatted with Markdown:
- versions used (SonarQube, Scanner, Plugin, and any relevant extension)
8.7 - error observed (wrap logs/code around triple quote ``` for proper formatting)
{“errors”:[{“msg”:“A user with provider id 'xxx’ and identity provider ‘aad’ already exists”}]}
We verified the user only has externalProvider set as 'sonarqube' so not sure why it would be giving us this error.
- steps to reproduce
call webapi to create user as local false
call /users/update_identity_provider to update the user with newExternalProvider = aad - potential workaround
none
P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour