fix: use default and additional scopes correctly

This commit is contained in:
Johan Siebens
2024-02-03 10:44:36 +01:00
parent dfd2fe9fdd
commit b8c752d04a
+2 -2
View File
@@ -42,7 +42,7 @@ func (p *OIDCProvider) GetLoginURL(redirectURI, state string) string {
ClientSecret: p.clientSecret, ClientSecret: p.clientSecret,
RedirectURL: redirectURI, RedirectURL: redirectURI,
Endpoint: p.provider.Endpoint(), Endpoint: p.provider.Endpoint(),
Scopes: []string{oidc.ScopeOpenID, "profile", "email"}, Scopes: p.scopes,
} }
return oauth2Config.AuthCodeURL(state, oauth2.ApprovalForce) return oauth2Config.AuthCodeURL(state, oauth2.ApprovalForce)
@@ -54,7 +54,7 @@ func (p *OIDCProvider) Exchange(redirectURI, code string) (*User, error) {
ClientSecret: p.clientSecret, ClientSecret: p.clientSecret,
RedirectURL: redirectURI, RedirectURL: redirectURI,
Endpoint: p.provider.Endpoint(), Endpoint: p.provider.Endpoint(),
Scopes: []string{oidc.ScopeOpenID, "profile", "email"}, Scopes: p.scopes,
} }
oauth2Token, err := oauth2Config.Exchange(context.Background(), code) oauth2Token, err := oauth2Config.Exchange(context.Background(), code)