forked from mystiq/dex
check if upstream contains preferrend username claim first
Signed-off-by: Rui Yang <ryang@pivotal.io> Signed-off-by: Rui Yang <ruiya@vmware.com>
This commit is contained in:
parent
4812079647
commit
52c39fb130
1 changed files with 3 additions and 3 deletions
|
@ -301,10 +301,10 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
|
|||
}
|
||||
hostedDomain, _ := claims["hd"].(string)
|
||||
|
||||
if c.preferredUsernameKey == "" {
|
||||
c.preferredUsernameKey = "preferred_username"
|
||||
preferredUsername, found := claims["preferred_username"].(string)
|
||||
if !found {
|
||||
preferredUsername, _ = claims[c.preferredUsernameKey].(string)
|
||||
}
|
||||
preferredUsername, _ := claims[c.preferredUsernameKey].(string)
|
||||
|
||||
if len(c.hostedDomains) > 0 {
|
||||
found := false
|
||||
|
|
Loading…
Reference in a new issue