Skip to content

Commit

Permalink
credentials/google: Add cloud-platform scope for ADC (#7887)
Browse files Browse the repository at this point in the history
  • Loading branch information
halvards authored Dec 2, 2024
1 parent 3c0586a commit 3ce87dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion credentials/google/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"google.golang.org/grpc/internal"
)

const defaultCloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"

var logger = grpclog.Component("credentials")

// DefaultCredentialsOptions constructs options to build DefaultCredentials.
Expand Down Expand Up @@ -120,7 +122,7 @@ var (
return alts.NewClientCreds(alts.DefaultClientOptions())
}
newADC = func(ctx context.Context) (credentials.PerRPCCredentials, error) {
return oauth.NewApplicationDefault(ctx)
return oauth.NewApplicationDefault(ctx, defaultCloudPlatformScope)
}
)

Expand Down

0 comments on commit 3ce87dd

Please sign in to comment.