Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scope to default application credentials #1151

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

rkrishnan2012
Copy link
Contributor

This PR added the capability to authenticate with application default credentials.

When the application default credentials are generated using workload identity federation like in a Github action, the generated JSON doesn't contain scopes. As a result, the google-auth-library defaults to a scope of https://www.googleapis.com/auth/cloud-platform, which doesn't include the androidpublisher scope.

To support all forms of application default credentials (including Identity Pool Credentials), we should specify a scope. Some more info about this is also in googleapis/google-auth-library-java#1274.

When using application default credentials with Workflow Identity Federation, the API call to GCP fails with "Request had insufficient authentication scopes.". This attempts to fix that by setting the scope in the GoogleCredentials object.
@SUPERCILEX
Copy link
Collaborator

cc @a-mackay

@SUPERCILEX SUPERCILEX merged commit 3847cc9 into Triple-T:master Nov 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants