Skip to content

Commit ae6cd1a

Browse files
committed
fix(oauth): When calling GetOAuthClientConfig pass scopes and audience to CommandConfigOauth.Build
1 parent b0530af commit ae6cd1a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

auth_providers/auth_oauth.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,6 @@ func (b *CommandConfigOauth) GetHttpClient() (*http.Client, error) {
220220
b.Scopes = DefaultScopes
221221
}
222222

223-
if b.Audience != "" {
224-
config.EndpointParams = map[string][]string{
225-
"Audience": {b.Audience},
226-
}
227-
}
228-
229223
ctx := context.WithValue(context.Background(), oauth2.HTTPClient, &http.Client{Transport: baseTransport})
230224
tokenSource := config.TokenSource(ctx)
231225

auth_providers/command_config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ func (s *Server) GetOAuthClientConfig() (*CommandConfigOauth, error) {
314314
WithClientSecret(s.ClientSecret).
315315
WithAccessToken(s.AccessToken).
316316
WithTokenUrl(s.OAuthTokenUrl).
317+
WithScopes(s.Scopes).
318+
WithAudience(s.Audience).
317319
Build()
318320

319321
vErr := oauthConfig.ValidateAuthConfig()

0 commit comments

Comments
 (0)