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

[Google Maps Places] - ADC - Impersonating Service Account failing #5883

Closed
7 tasks done
shaunmitchellve opened this issue Dec 16, 2024 · 2 comments
Closed
7 tasks done

Comments

@shaunmitchellve
Copy link

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

Screenshot 2024-12-16 at 3 37 54 PM

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://gist.github.com/shaunmitchellve/40cf10cd968ce19e29a50133d8fb3f3a

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

  1. Run gcloud auth application-default login --impersonate-service-account <SA-EMAIL>
  2. Run the code node test.mjs

This returns the error 400 undefined: Getting metadata from plugin failed with error: INVALID_ARGUMENT: unable to impersonate: Request contains an invalid argument.

When running code that utilizes the impersonation like Google Cloud SignedURLs for Storage Buckets it works fine.

application_default_credentials.json
{ "delegates": [], "service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/[REDACTED]@[REDACTED].iam.gserviceaccount.com:generateAccessToken", "source_credentials": { "account": "", "client_id": "[REDACTED]", "client_secret": "[REDACTED]", "refresh_token": "[REDACTED]", "type": "authorized_user", "universe_domain": "googleapis.com" }, "type": "impersonated_service_account" }

A clear and concise description of what the bug is, and what you expected to happen.

When running the Places Client using Application Default Credentials the simple / sample code runs fine, however when impersonating a service account the GAX code seems to be not setup properly.

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

Impersonating a service account using ADC is a common practice and in some cases it's required for the application if it uses Google Cloud Storage Signed URLs.

Copy link
Contributor

Issue was opened with an invalid reproduction link. Please make sure the repository is a valid, publicly-accessible github repository, and make sure the url is complete (example: https://github.com/googleapis/google-cloud-node)

@shaunmitchellve
Copy link
Author

shaunmitchellve commented Dec 17, 2024

Re-opening as the reproduction link is a public gist

https://gist.github.com/shaunmitchellve/40cf10cd968ce19e29a50133d8fb3f3a

You need to fix your GitHub actions as they are auto-closing issues that are correct and follow the template.

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

No branches or pull requests

1 participant