From b28098dde8aacc1f3693972ed36f08ee6efe47fc Mon Sep 17 00:00:00 2001 From: Happy2C0de <46957159+Happy2C0de@users.noreply.github.com> Date: Thu, 19 Aug 2021 13:28:32 +0200 Subject: [PATCH] Revert querying preferrredUsernameKey Signed-off-by: Happy2C0de <46957159+Happy2C0de@users.noreply.github.com> --- connector/oidc/oidc.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/connector/oidc/oidc.go b/connector/oidc/oidc.go index 318bcf86..b0467330 100644 --- a/connector/oidc/oidc.go +++ b/connector/oidc/oidc.go @@ -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