Revert querying preferrredUsernameKey

Signed-off-by: Happy2C0de <46957159+Happy2C0de@users.noreply.github.com>
This commit is contained in:
Happy2C0de 2021-08-19 13:28:32 +02:00
parent 1608b473eb
commit b28098dde8

View File

@ -295,11 +295,9 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
return identity, fmt.Errorf("missing \"%s\" claim", userNameKey) return identity, fmt.Errorf("missing \"%s\" claim", userNameKey)
} }
prefUsername := "preferred_username" preferredUsername, found := claims["preferred_username"].(string)
preferredUsername, found := claims[prefUsername].(string)
if (!found || c.overrideClaimMapping) && c.preferredUsernameKey != "" { if (!found || c.overrideClaimMapping) && c.preferredUsernameKey != "" {
prefUsername = c.preferredUsernameKey preferredUsername, _ = claims[c.preferredUsernameKey].(string)
preferredUsername, _ = claims[prefUsername].(string)
} }
hasEmailScope := false hasEmailScope := false