Make the nickname claim conditional on the openid scope too
This is only needed for OIDC anyway
This commit is contained in:
parent
f4be6e135a
commit
aec65d8e19
|
@ -61,9 +61,10 @@ func UserInfo(ctx *gin.Context) {
|
||||||
|
|
||||||
if s == "openid" {
|
if s == "openid" {
|
||||||
userinfoRes["sub"] = *tokenInfo.Sub
|
userinfoRes["sub"] = *tokenInfo.Sub
|
||||||
} else if s == "username" {
|
if value, ok := (*userinfo)["username"]; ok {
|
||||||
// Add "nickname" field for OIDC compatibility
|
// Add "nickname" field for OIDC compatibility
|
||||||
userinfoRes["nickname"] = userinfoRes[s]
|
userinfoRes["nickname"] = value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue