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

Fetch ID Token for an External Account Credential (w/Impersonation) #1252

Open
mrogg opened this issue Mar 15, 2023 · 0 comments
Open

Fetch ID Token for an External Account Credential (w/Impersonation) #1252

mrogg opened this issue Mar 15, 2023 · 0 comments

Comments

@mrogg
Copy link

mrogg commented Mar 15, 2023

Problem

I want to retrieve an ID token for a Credential returned from google.auth.default(), specifically an aws.Credentials that is impersonating a Google Service Account.

Unfortunately, the most straightforward approach seems to be passing the private _impersonated_credentials of the underlying external_account.Credentials to google.auth.impersonated_credentials.IDTokenCredentials().

Potential Solutions

  • Make the private _impersonated_credentials of the underlying external_account.Credentials a public property
  • Add an id_token() method that makes the google.auth.impersonated_credentials.IDTokenCredentials() call with the private _impersonated_credentials.
  • Add an external_account.IDTokenCredentials that takes an external_account.Credentials and does the necessary work to fetch an ID token it whatever way is most consistent with the rest of the google auth library.

Please let me know if I'm missing an existing simpler solution.

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