Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion connector/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ type gitlabConnector struct {

// oauth2Config builds the OAuth2 client configuration and scopes for this connector.
func (c *gitlabConnector) oauth2Config(scopes connector.Scopes) *oauth2.Config {
gitlabScopes := []string{scopeUser, scopeOpenID}
gitlabScopes := []string{scopeUser}
if c.groupsRequired(scopes.Groups) {
gitlabScopes = append(gitlabScopes, scopeOpenID)
if c.inheritedGroups {
gitlabScopes = append(gitlabScopes, scopeReadAPI)
}
Expand Down
2 changes: 1 addition & 1 deletion connector/gitlab/gitlab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func TestOAuth2ConfigScopesForInheritedGroups(t *testing.T) {
c := gitlabConnector{inheritedGroups: true}

cfg := c.oauth2Config(connector.Scopes{})
expectEquals(t, cfg.Scopes, []string{scopeUser, scopeOpenID})
expectEquals(t, cfg.Scopes, []string{scopeUser})

cfg = c.oauth2Config(connector.Scopes{Groups: true})
expectEquals(t, cfg.Scopes, []string{scopeUser, scopeOpenID, scopeReadAPI})
Expand Down
Loading