mirror of
https://github.com/thomiceli/opengist.git
synced 2026-08-07 07:14:49 +00:00
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
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:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user