Hi, good morning, I had a problem implementing authentication with GitLab, I’m talking to you.
We are migrating from SonarQube version 7.9 to version 9.9, so I tried Sonar 9.9 without updating and checked that Gitlab authentication was working fine, among other things I did the update from 7.9 → 8.9 → 9.9 apparently everything went fine al incorporate authentication with GitLab and trying to log in appears on the screen
You are not authorized to access this page. Contact the administrator.
Reason: Failed to authenticate with login ‘user.name’
try to follow the solutions from other threads with this message,
I corrected the config url in gilab and SonarQube but apparently nothing works:
You started up a fresh instance of 9.9 as a test and configured it for GitLab authentication, and everything worked fine.
And then you migrated your 7.9 instance through 8.9 to 9.9. You configured it for GitLab authentication with all the same values, and authentication fails.
If I got that right, were both instances in about the same place on the network with the same “helpful” things on the network between them and GitLab?
I had about the same issue …
but i could login but my collegues not.
I reverted snapshot and went step by step, and let my college login (via gitlab each time)
that was ok and we reached finaly sonarcube 9.9.0. was ok for both of us.
afterwards i asked another collegue to login … and he again had the error.
when i reverted my snapshot to sonar 8.9.1 he cold login (with 8.9.10 also issue for the 3th collegue)
will debug later on a bit further. The upgrade process itself gave no errors / warnings
Good news, we were able to reproduce that issue. It seems like the plugin you have been using is not compatible with the implementation of gitlab authentication done in SonarQube 8.9.
The problem is that external_id which is populated by a plugin is a username from Gtilab.
In SonarQube 8.9 implementation assumes it should be gitlab user id.
In order to migrate your users to be compatible with SonarQube you can try to map users by emails from your gitlab instance to SonarQube and execute following WS to migrate them:
curl -X POST -u admin_login:admin_password '/api/users/update_identity_provider?login=sonarqube_user.login&newExternalProvider=gitlab&newExternalIdentity=gitlab_user.id'
This call will change value of external_id column for the specific user to be user id instead of username which will allow users to authenticate.