-
Notifications
You must be signed in to change notification settings - Fork 210
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 (routing) not playing nicely with WIF #459
Comments
Hi there @emigre459 👋! Thank you for opening an issue. Our team will triage this as soon as we can. Please take a moment to review the troubleshooting steps which lists common error messages and their resolution steps. |
Hi there - could you please provide the debug output for the complete GitHub Actions workflow run? How are you passing an authentication to the Maps API calls? |
Happy to! Is this what you were thinking? |
I think those are the runner diagnostics. I need the step debugs (sorry). You have to set a secret or variable to Without the debug logs, my best guess is that the Google Maps API does not support authentication with a federated token. |
Let's try that again! |
Thanks @emigre459. I'm not a python expert, but I think you need to pass in the oauth scopes when you create the credential in your python client. Something like SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
credentials, project = google.auth.default(scopes=SCOPES) It looks like all the routing APIs using the "cloud-platform" scope, which is what we request in the federated token. |
I tried that actually and it didn't work for some odd reason. I was under the impression that FAILED tests/test_amenities_pull.py::test_amenities_search - google.api_core.exceptions.Unauthenticated: 401 Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. |
Hi @emigre459 - I'm not really sure how to help debug this. It doesn't seem like the Google Maps API client is properly honoring the Workload Identity credential type. You might try opening an issue on the Google Maps Python API client to see if they can help. Unfortunately I'm not an expert in Python or that client - this action sets up the "credential file" in the proper format that all Google Cloud client libraries are supposed to honor. |
TL;DR
When using other GCP services (e.g. BigQuery, CloudStorage, etc.), I can use WIF with no service account in GH runners without issue. Trying to do the same approach with Google Maps Routing v2 keeps failing with a scoping error I cannot resolve.
Expected behavior
The error mentioned in the TLDR; is:
I have not been able to find any maps-specific scopes that make sense nor have I been able to find Maps roles to add to my WIF pool to enable usage with that API as described in #454 (even adding mapsadmin.admin role did not solve anything). Is it possible that WIF (without a service account at least) does not play nicely with GMaps APIs currently and an API key approach is the only solve for now?
Observed behavior
No response
Action YAML
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: