feat: Add "sub" claim for the openid scope
Required by OIDC clients like Gitea
This commit is contained in:
parent
7de5f11bcc
commit
20ad51f214
|
@ -57,6 +57,8 @@ 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" {
|
||||||
|
userinfoRes["sub"] = *tokenInfo.Sub
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue