Skip to content
Snippets Groups Projects
Commit 52c39fb1 authored by Rui Yang's avatar Rui Yang Committed by Rui Yang
Browse files

check if upstream contains preferrend username claim first


Signed-off-by: default avatarRui Yang <ryang@pivotal.io>
Signed-off-by: default avatarRui Yang <ruiya@vmware.com>
parent 48120796
No related branches found
No related tags found
No related merge requests found
...@@ -301,10 +301,10 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I ...@@ -301,10 +301,10 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
} }
hostedDomain, _ := claims["hd"].(string) hostedDomain, _ := claims["hd"].(string)
if c.preferredUsernameKey == "" { preferredUsername, found := claims["preferred_username"].(string)
c.preferredUsernameKey = "preferred_username" if !found {
preferredUsername, _ = claims[c.preferredUsernameKey].(string)
} }
preferredUsername, _ := claims[c.preferredUsernameKey].(string)
if len(c.hostedDomains) > 0 { if len(c.hostedDomains) > 0 {
found := false found := false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment