feat: Add "sub" claim for the openid scope

Required by OIDC clients like Gitea
This commit is contained in:
Peter Cai 2023-02-24 16:05:47 +01:00
parent 7de5f11bcc
commit 20ad51f214
1 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,8 @@ func UserInfo(ctx *gin.Context) {
for _, s := range scopes {
if value, ok := (*userinfo)[s]; ok {
userinfoRes[s] = value
} else if s == "openid" {
userinfoRes["sub"] = *tokenInfo.Sub
}
}
}