public static final String API_SCOPE = "api";
public static final String READ_USER_SCOPE = "read_user";
+ public static final String KEY = "gitlab";
private final GitLabSettings gitLabSettings;
private final ScribeGitLabOauth2Api scribeApi;
private final GitLabRestClient gitLabRestClient;
@Override
public String getKey() {
- return "gitlab";
+ return KEY;
}
@Override
checkState(isEnabled(), "GitLab authentication is disabled");
return new ServiceBuilder(gitLabSettings.applicationId())
.apiSecret(gitLabSettings.secret())
- .defaultScope(API_SCOPE)
+ .defaultScope(gitLabSettings.syncUserGroups() ? API_SCOPE : READ_USER_SCOPE)
.callback(context.getCallbackUrl());
}