Browse Source

fix: remove redundant scope check from Google connector

Since `groups` are not considered a valid scope by Google, we cannot
pass to the `scope`. Although @damieva introduced `claimMapping` in
https://github.com/dexidp/dex/issues/2653 to address this issue, it does
not seem to work with the current implementation of the Google
connector.

This commit resolves the issue by removing the unnecessary `group` scope
check, as `adminSrv` is only initialized when the user wants to retrieve
groups.

Signed-off-by: Sunghoon Kang <hoon@akuity.io>
pull/2917/head
Sunghoon Kang 3 years ago
parent
commit
344527be3f
No known key found for this signature in database
GPG Key ID: 35D0CE4964B093C0
  1. 2
      connector/google/google.go

2
connector/google/google.go

@ -226,7 +226,7 @@ func (c *googleConnector) createIdentity(ctx context.Context, identity connector
}
var groups []string
if s.Groups && c.adminSrv != nil {
if c.adminSrv != nil {
checkedGroups := make(map[string]struct{})
groups, err = c.getGroups(claims.Email, c.fetchTransitiveGroupMembership, checkedGroups)
if err != nil {

Loading…
Cancel
Save