fix(oidc): scope includes trailing whitespace if groups not configured (#775)
Go CI / Check (push) Has been cancelled
Go CI / Test (sqlite, 1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, macOS-latest) (push) Has been cancelled
Go CI / Build (1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, windows-latest) (push) Has been cancelled
Go CI / Lint (push) Has been cancelled
Go CI / Test (mysql, 1.26, mysql:8, ubuntu-latest, 3306:3306) (push) Has been cancelled
Go CI / Test (postgres, 1.26, postgres:16, ubuntu-latest, 5432:5432) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, macOS-latest) (push) Has been cancelled

This commit is contained in:
Bnyro
2026-07-27 03:56:15 +02:00
committed by GitHub
parent d45898b67f
commit 0f62b87733
+6 -4
View File
@@ -20,15 +20,17 @@ type OIDCProvider struct {
} }
func (p *OIDCProvider) RegisterProvider() error { func (p *OIDCProvider) RegisterProvider() error {
scopes := []string{"openid", "email", "profile"}
if config.C.OIDCGroupClaimName != "" {
scopes = append(scopes, config.C.OIDCGroupClaimName)
}
oidcProvider, err := openidConnect.New( oidcProvider, err := openidConnect.New(
config.C.OIDCClientKey, config.C.OIDCClientKey,
config.C.OIDCSecret, config.C.OIDCSecret,
urlJoin(p.URL, "/oauth/openid-connect/callback"), urlJoin(p.URL, "/oauth/openid-connect/callback"),
config.C.OIDCDiscoveryUrl, config.C.OIDCDiscoveryUrl,
"openid", scopes...,
"email",
"profile",
config.C.OIDCGroupClaimName,
) )
if err != nil { if err != nil {