-
Notifications
You must be signed in to change notification settings - Fork 314
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
Generate id_token from default credentials #590
Comments
@arithmetic1728 I stumbled upon this issue recently. Any plan to add support for user credentials? Or pointer in the right direction? |
This is already 2 years old, but it is still not clear why it's impossible to generate In my use case, I would want to build an API server (exposed via Cloud Endpoints with OIDC authentication) and a CLI tool, that interacts with this server. Currently, I can't simply use Can someone give me some leads to what am I doing wrong? Thank you! |
No sure if still useful to someone, but after few searches I did not find an actual solution, but instead a clear indication in the documentation that the given method does NOT work for user credentials, and gcloud need to be used https://cloud.google.com/run/docs/authenticating/service-to-service#use_the_authentication_libraries
https://cloud.google.com/docs/authentication#user-accounts
I ended up with a code like this:
Hope this may be useful to someone. I also find another post on the same topic: https://stackoverflow.com/questions/67113855/how-can-i-retrieve-an-id-token-to-access-a-google-cloud-function/67122583#67122583 |
Is your feature request related to a problem? Please describe.
Currently,
google.auth.default()
generatesCredentials
that contain.token
that is an access token.We'd like to also generate
id_token
with the appropriate audience starting from default credentials.This would allow us to submit requests that use
id_token
uniformly among different environments:Describe the solution you'd like
It would be great to add a method to
google.auth.credentials.Credentials
that allowsid_token
generation, e.g.Describe alternatives you've considered
So far, we had to rely on piece-meal approaches, like this example from https://github.com/apache/airflow/blob/master/airflow/providers/google/common/utils/id_token_credentials.py
This unnecessarily increases the complexity of third-party apps, and we have to re-implement the same logic in each one of them.
It would be preferable to incorporate such logic into this library instead.
Additional context
The text was updated successfully, but these errors were encountered: