@@ -409,21 +409,18 @@ func (s *StandardOp) RequestTokens(ctx context.Context, cic *clientinstance.Clai
409409 return nil , err
410410 }
411411
412- providerToken := tokens .IDToken
413- if s .ClientCredentialsFlow && len (providerToken ) == 0 {
414- providerToken = tokens .AccessToken
415- }
412+ idToken := tokens .IDToken
416413
417414 if s .GQSign {
418- if len (providerToken ) == 0 {
419- return nil , fmt .Errorf ("cannot apply GQ signature: missing provider token" )
415+ if len (idToken ) == 0 {
416+ return nil , fmt .Errorf ("cannot apply GQ signature: missing id token" )
420417 }
421418
422419 var gqToken []byte
423420 if s .ClientCredentialsFlow {
424- gqToken , err = CreateGQBoundToken (ctx , providerToken , s , string (cicHash ))
421+ gqToken , err = CreateGQBoundToken (ctx , idToken , s , string (cicHash ))
425422 } else {
426- gqToken , err = CreateGQToken (ctx , providerToken , s )
423+ gqToken , err = CreateGQToken (ctx , idToken , s )
427424 }
428425 if err != nil {
429426 return nil , err
@@ -434,7 +431,9 @@ func (s *StandardOp) RequestTokens(ctx context.Context, cic *clientinstance.Clai
434431 return tokens , nil
435432}
436433
437- func (s * StandardOp ) RequestClientCredentialsTokens (ctx context.Context , scopes []string ) (* simpleoidc.Tokens , error ) {
434+ func (s * StandardOp ) clientCredentialsRequestTokens (ctx context.Context , _ string ) (* simpleoidc.Tokens , error ) {
435+ scopes := s .Scopes
436+
438437 if s .ClientSecret == "" {
439438 return nil , fmt .Errorf ("client credentials flow requires a client secret" )
440439 }
@@ -495,7 +494,7 @@ func (s *StandardOp) RequestClientCredentialsTokens(ctx context.Context, scopes
495494 return nil , fmt .Errorf ("failed to decode token response: %w" , err )
496495 }
497496
498- if tokenResponse .AccessToken == "" && tokenResponse . IDToken == "" {
497+ if tokenResponse .IDToken == "" {
499498 return nil , fmt .Errorf ("token endpoint response missing access_token and id_token" )
500499 }
501500
@@ -506,10 +505,6 @@ func (s *StandardOp) RequestClientCredentialsTokens(ctx context.Context, scopes
506505 }, nil
507506}
508507
509- func (s * StandardOp ) clientCredentialsRequestTokens (ctx context.Context , _ string ) (* simpleoidc.Tokens , error ) {
510- return s .RequestClientCredentialsTokens (ctx , s .Scopes )
511- }
512-
513508func (s * StandardOp ) deviceFlowRequestTokens (ctx context.Context , cicHash string ) (* simpleoidc.Tokens , error ) {
514509 cookieHandler , err := configCookieHandler ()
515510 if err != nil {
0 commit comments