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

feat: Get id token for impersonated service account #579

Conversation

gjvanahee
Copy link

Hello, thanks for a maintaining a great sdk. In order to autenticate impersonated service accounts with e.g. a Cloud Run service, the ISAC IdToken has to be fetched for a given target audience.

I have made this PR to allow this using the ImpersonatedServiceAccountCredentials class, so the AuthTokenMiddleware can use it to add the ISAC IdToken to a request. The change also allows ApplicationDefaultCredentials::getIdTokenMiddleware() and getIdTokenCredentials() to find ImpersonatedServiceAccountCredentials.

@gjvanahee gjvanahee requested a review from a team as a code owner September 20, 2024 10:10
Copy link

google-cla bot commented Sep 20, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gjvanahee gjvanahee changed the title Get id token for impersonated service account feat: Get id token for impersonated service account Sep 20, 2024
…d with an IdToken

feat: Allow Impersonated SA Credentials to make requests authenticated with an IdToken

chore: Removed uncommented code
@gjvanahee gjvanahee force-pushed the get-id-token-for-impersonated-service-account branch from 4b0089f to 48554e6 Compare September 20, 2024 11:10
@bshaffer
Copy link
Contributor

bshaffer commented Oct 1, 2024

Hi @gjvanahee ! This looks great, thank you for contributing this.

Coincidentally, I was just working on this in #580! We will get this merged soon, and then merge your additions as well.

@gjvanahee
Copy link
Author

Hey @bshaffer, That is great to hear! Let me know if I can help out.

@bshaffer
Copy link
Contributor

bshaffer commented Oct 4, 2024

@gjvanahee If you'd like to help, you could use test #580 in your own use-case. I would love to have you review it!

composer require google/auth:dev-add-impersonated-service-account-credentials

I'll use the tests you've written in this PR as well to make sure it works the same.

Thanks again

@bshaffer
Copy link
Contributor

bshaffer commented Oct 5, 2024

Closing this PR as it should be completely implemented by #580

@bshaffer bshaffer closed this Oct 5, 2024
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