[KEYCLOAK-14913] GitLab Identity Provider shouldn't request for 'api' scope

This commit is contained in:
Douglas Palmer 2021-02-23 18:00:07 -08:00 committed by Marek Posolda
parent 99c1ee7f5a
commit 852593310f
3 changed files with 4 additions and 4 deletions

View file

@ -48,7 +48,7 @@ public class GitLabIdentityProvider extends OIDCIdentityProvider implements Soc
public static final String AUTH_URL = "https://gitlab.com/oauth/authorize";
public static final String TOKEN_URL = "https://gitlab.com/oauth/token";
public static final String USER_INFO = "https://gitlab.com/api/v4/user";
public static final String API_SCOPE = "api";
public static final String READ_USER_SCOPE = "read_user";
public GitLabIdentityProvider(KeycloakSession session, OIDCIdentityProviderConfig config) {
super(session, config);
@ -59,7 +59,7 @@ public class GitLabIdentityProvider extends OIDCIdentityProvider implements Soc
String defaultScope = config.getDefaultScope();
if (defaultScope.equals(SCOPE_OPENID)) {
config.setDefaultScope((API_SCOPE + " " + defaultScope).trim());
config.setDefaultScope((READ_USER_SCOPE + " " + defaultScope).trim());
}
}

View file

@ -648,7 +648,7 @@ key=Key
#gitlab-application-secret=Application Secret
#gitlab.application-id.tooltip=Application Id for the application you created in your GitLab Applications account menu
#gitlab.application-secret.tooltip=Secret for the application that you created in your GitLab Applications account menu
#gitlab.default-scopes.tooltip=Scopes to ask for on login. Will always ask for openid. Additionally adds api if you do not specify anything.
#gitlab.default-scopes.tooltip=Scopes to ask for on login. Will always ask for openid. Additionally adds read_user if you do not specify anything.
#bitbucket-consumer-key=Consumer Key
#bitbucket-consumer-secret=Consumer Secret
#bitbucket.key.tooltip=Bitbucket OAuth Consumer Key

View file

@ -752,7 +752,7 @@ gitlab-application-id=Application Id
gitlab-application-secret=Application Secret
gitlab.application-id.tooltip=Application Id for the application you created in your GitLab Applications account menu
gitlab.application-secret.tooltip=Secret for the application that you created in your GitLab Applications account menu
gitlab.default-scopes.tooltip=Scopes to ask for on login. Will always ask for openid. Additionally adds api if you do not specify anything.
gitlab.default-scopes.tooltip=Scopes to ask for on login. Will always ask for openid. Additionally adds read_user if you do not specify anything.
bitbucket-consumer-key=Consumer Key
bitbucket-consumer-secret=Consumer Secret
bitbucket.key.tooltip=Bitbucket OAuth Consumer Key