Skip to content

Commit

Permalink
Revert querying preferrredUsernameKey
Browse files Browse the repository at this point in the history
Signed-off-by: Happy2C0de <[email protected]>
  • Loading branch information
Happy2C0de committed Jan 19, 2022
1 parent 1608b47 commit b28098d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions connector/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,9 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
return identity, fmt.Errorf("missing \"%s\" claim", userNameKey)
}

prefUsername := "preferred_username"
preferredUsername, found := claims[prefUsername].(string)
preferredUsername, found := claims["preferred_username"].(string)
if (!found || c.overrideClaimMapping) && c.preferredUsernameKey != "" {
prefUsername = c.preferredUsernameKey
preferredUsername, _ = claims[prefUsername].(string)
preferredUsername, _ = claims[c.preferredUsernameKey].(string)
}

hasEmailScope := false
Expand Down

0 comments on commit b28098d

Please sign in to comment.