From 48ef9acc1994bc28d28cac737c753a9ff32f6038 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Fri, 16 Jan 2026 21:59:05 +0800 Subject: [PATCH] support the username returned by Synology DSM SSO Server during OIDC authentication (#449) --- pkg/auth/oauth2/provider/oidc/oidc_provider.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/auth/oauth2/provider/oidc/oidc_provider.go b/pkg/auth/oauth2/provider/oidc/oidc_provider.go index ba47e8bc..94f4eea2 100644 --- a/pkg/auth/oauth2/provider/oidc/oidc_provider.go +++ b/pkg/auth/oauth2/provider/oidc/oidc_provider.go @@ -19,6 +19,7 @@ import ( // OIDCClaims represents OIDC claims type OIDCClaims struct { PreferredUserName string `json:"preferred_username"` + UserName string `json:"username"` Name string `json:"name"` Email string `json:"email"` } @@ -113,6 +114,10 @@ func (p *OIDCProvider) GetUserInfo(c core.Context, oauth2Token *oauth2.Token) (* userName = claims.PreferredUserName } + if userName == "" { + userName = claims.UserName + } + if email == "" { email = claims.Email }