Add "nickname" claim for better OIDC compat
This commit is contained in:
parent
20ad51f214
commit
950f521002
|
@ -57,8 +57,13 @@ func UserInfo(ctx *gin.Context) {
|
||||||
for _, s := range scopes {
|
for _, s := range scopes {
|
||||||
if value, ok := (*userinfo)[s]; ok {
|
if value, ok := (*userinfo)[s]; ok {
|
||||||
userinfoRes[s] = value
|
userinfoRes[s] = value
|
||||||
} else if s == "openid" {
|
}
|
||||||
|
|
||||||
|
if s == "openid" {
|
||||||
userinfoRes["sub"] = *tokenInfo.Sub
|
userinfoRes["sub"] = *tokenInfo.Sub
|
||||||
|
} else if s == "username" {
|
||||||
|
// Add "nickname" field for OIDC compatibility
|
||||||
|
userinfoRes["nickname"] = userinfoRes[s]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue