Skip to content

fix: use IdTokenCredentials for IAP request #1790

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

Merged

Conversation

chingor13
Copy link
Member

@chingor13 chingor13 commented Dec 6, 2019

Fixes #1643

In google-auth-library 0.17.0 (the latest 0.18.0 is preferred though), we introduced a new interface IdTokenProvider which a subset of GoogleCredentials types can provide (ServiceAccountCredentials and ComputeEngineCredentials both implement IdTokenProvider). The interface abstract the mechanism for fetching an Open ID token using the means available for that type of credential.

This should also drastically simplify the sample code and not require you to handle the JWT encoding/Open ID implementation.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 6, 2019
@chingor13 chingor13 marked this pull request as ready for review December 6, 2019 18:06
@chingor13 chingor13 requested a review from a team December 6, 2019 18:06
Copy link
Contributor

@lesv lesv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot easier!

@lesv
Copy link
Contributor

lesv commented Dec 9, 2019

Do you need us to merge?

@chingor13 chingor13 merged commit 938bc1b into GoogleCloudPlatform:master Dec 9, 2019
@chingor13 chingor13 deleted the iap-idtoken-credentials branch December 9, 2019 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BuildIapRequest fails when using workload Identity
4 participants