Skip to content

Commit

Permalink
fix(internal): fix self-signed detection with scopes (#1096)
Browse files Browse the repository at this point in the history
Removed the requirement on length of scopes passed. Checking the EnableJwtWithScope internal option should be sufficient since it will only be passed with our generated clients that will always include at least the platform scope and a default audience.
Fixes: #1092
  • Loading branch information
codyoss committed Jun 30, 2021
1 parent 222262a commit ff1d20b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/creds.go
Expand Up @@ -99,7 +99,7 @@ func credentialsFromJSON(ctx context.Context, data []byte, ds *DialSettings) (*g
}

func isSelfSignedJWTFlow(data []byte, ds *DialSettings) (bool, error) {
if (ds.EnableJwtWithScope || ds.HasCustomAudience() || len(ds.GetScopes()) == 0) &&
if (ds.EnableJwtWithScope || ds.HasCustomAudience()) &&
ds.ImpersonationConfig == nil {
// Check if JSON is a service account and if so create a self-signed JWT.
var f struct {
Expand Down

0 comments on commit ff1d20b

Please sign in to comment.