feat(rest): support generateIdToken in impersonation url #14853
+34
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There could be different formats of impersonation URLs in the ADC credential files like:
We already use
base_url:generateAccessToken
to generate access token.base_url:generateIdToken
is not an alternative approach to generate access token, it is used for requesting a JWT token, then we can decode it and verify theemail
andaud
.No matter which of them appears in the impersonation URL in the credential file, we will ignore them, we will always use
base_url[:generateAccessToken]
to request access token, and usebase_url[:generateIdToken]
to do verification.As mentioned by Brent, the design of impersonation URL is TBD,
:generateAccessToken
and:generateIdToken
could be removed from the impersonation URL in the credential files. I think it makes sense to support all the formats above.This change is