allow customizing OICD scopes

This commit is contained in:
yusing
2025-01-13 08:30:46 +08:00
parent 76fe5345d8
commit 81d96394b9
3 changed files with 6 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import (
U "github.com/yusing/go-proxy/internal/api/v1/utils"
"github.com/yusing/go-proxy/internal/common"
E "github.com/yusing/go-proxy/internal/error"
"github.com/yusing/go-proxy/internal/utils/strutils"
"golang.org/x/oauth2"
)
@@ -39,7 +40,7 @@ func InitOIDC(issuerURL, clientID, clientSecret, redirectURL string) error {
ClientSecret: clientSecret,
RedirectURL: redirectURL,
Endpoint: provider.Endpoint(),
Scopes: []string{oidc.ScopeOpenID, "profile", "email"},
Scopes: strutils.CommaSeperatedList(common.OIDCScopes),
}
return nil