Gitlab will not redirect me back to SonarQube if authentication fails, it will tell me that authentication failed. That is exactly how OAuth works. I mean authentication is handled by Gitlab, I have no idea what SonarQube does for it to be even possible to fail there.
So, I got TRACE logs from SonarQube:
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][o.s.s.p.w.UserSessionFilter] Thread[http-nio-0.0.0.0-9000-exec-90,5,main] serves /oauth2/callback/gitlab
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=1ms | sql=select p.prop_key as "key", p.is_empty as empty, p.text_value as textValue, p.clob_value as clobValue, p.entity_uuid as entityUuid, p.user_uuid as userUuid from properties p where p.prop_key=? and p.entity_uuid is null and p.user_uuid is null | params=sonar.forceRedirectOnDefaultAdminCredentials
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=1ms | sql=select p.prop_key as "key", p.is_empty as empty, p.text_value as textValue, p.clob_value as clobValue, p.entity_uuid as entityUuid, p.user_uuid as userUuid from properties p where p.prop_key=? and p.entity_uuid is null and p.user_uuid is null | params=sonar.auth.gitlab.enabled
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=0ms | sql=select p.prop_key as "key", p.is_empty as empty, p.text_value as textValue, p.clob_value as clobValue, p.entity_uuid as entityUuid, p.user_uuid as userUuid from properties p where p.prop_key=? and p.entity_uuid is null and p.user_uuid is null | params=sonar.auth.gitlab.applicationId.secured
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=0ms | sql=select p.prop_key as "key", p.is_empty as empty, p.text_value as textValue, p.clob_value as clobValue, p.entity_uuid as entityUuid, p.user_uuid as userUuid from properties p where p.prop_key=? and p.entity_uuid is null and p.user_uuid is null | params=sonar.auth.gitlab.secret.secured
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=0ms | sql=select p.prop_key as "key", p.is_empty as empty, p.text_value as textValue, p.clob_value as clobValue, p.entity_uuid as entityUuid, p.user_uuid as userUuid from properties p where p.prop_key=? and p.entity_uuid is null and p.user_uuid is null | params=sonar.core.serverBaseURL
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=0ms | sql=select p.prop_key as "key", p.is_empty as empty, p.text_value as textValue, p.clob_value as clobValue, p.entity_uuid as entityUuid, p.user_uuid as userUuid from properties p where p.prop_key=? and p.entity_uuid is null and p.user_uuid is null | params=sonar.auth.gitlab.groupsSync
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=1ms | sql=select p.prop_key as "key", p.is_empty as empty, p.text_value as textValue, p.clob_value as clobValue, p.entity_uuid as entityUuid, p.user_uuid as userUuid from properties p where p.prop_key=? and p.entity_uuid is null and p.user_uuid is null | params=sonar.auth.gitlab.url
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=2ms | sql=SELECT sa.scm_account as "scm_account", u.uuid as uuid, u.login as login, u.name as name, u.email as email, u.active as "active", u.salt as "salt", u.crypted_password as "cryptedPassword", u.hash_method as "hashMethod", u.external_id as "externalId", u.external_login as "externalLogin", u.external_identity_provider as "externalIdentityProvider", u.user_local as "local", u.reset_password as "resetPassword", u.homepage_type as "homepageType", u.homepage_parameter as "homepageParameter", u.last_connection_date as "lastConnectionDate", u.last_sonarlint_connection as "lastSonarlintConnectionDate", u.created_at as "createdAt", u.updated_at as "updatedAt" FROM users u left outer join scm_accounts sa on sa.user_uuid = u.uuid WHERE u.external_id=? AND u.external_identity_provider=? | params=34, gitlab
2024.07.18 13:51:48 TRACE web[f97cbe6b-384e-4d89-be61-8c055b16835f][sql] time=2ms | sql=SELECT sa.scm_account as "scm_account", u.uuid as uuid, u.login as login, u.name as name, u.email as email, u.active as "active", u.salt as "salt", u.crypted_password as "cryptedPassword", u.hash_method as "hashMethod", u.external_id as "externalId", u.external_login as "externalLogin", u.external_identity_provider as "externalIdentityProvider", u.user_local as "local", u.reset_password as "resetPassword", u.homepage_type as "homepageType", u.homepage_parameter as "homepageParameter", u.last_connection_date as "lastConnectionDate", u.last_sonarlint_connection as "lastSonarlintConnectionDate", u.created_at as "createdAt", u.updated_at as "updatedAt" FROM users u left outer join scm_accounts sa on sa.user_uuid = u.uuid WHERE u.external_login=? AND u.external_identity_provider=? | params=fade, gitlab
2024.07.18 13:51:48 DEBUG web[f97cbe6b-384e-4d89-be61-8c055b16835f][auth.event] login failure [cause|Failed to authenticate with login 'fade'][method|OAUTH2][provider|EXTERNAL|GitLab][IP|127.0.0.1|][login|fade]
Is there any way how to check what the value of external_id is? It is not in the output of /api/users/search.