Fix Google id_token to sign with RS256 and expose JWKS public key#166
Open
ikad wants to merge 1 commit into
Open
Fix Google id_token to sign with RS256 and expose JWKS public key#166ikad wants to merge 1 commit into
ikad wants to merge 1 commit into
Conversation
Contributor
|
@ikad is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
/oauth2/v3/certsJWKS endpoint (previously returned an emptykeys: [])id_token_signing_alg_values_supportedfrom["HS256"]to["RS256"]Problem
The Google emulator issued id_tokens signed with HS256 using a hardcoded secret, while OIDC client libraries universally expect RS256 verified against the JWKS endpoint. This caused id_token verification to fail for any library that:
/.well-known/openid-configuration→jwks_urijose,openid-client, Auth.js)The JWKS endpoint also returned
{ keys: [] }, making signature verification impossible even if libraries attempted it.Changes
packages/@emulators/google/src/routes/oauth.tsgenerateKeyPair("RS256")) — same pattern as the Microsoft and Okta emulatorskidheader/oauth2/v3/certspackages/@emulators/google/src/__tests__/google.test.tsid_tokenpresence and claims assertions (iss,aud,sub,email,email_verified,name) to the existing token exchange testjwtVerifyagainst the JWKS endpoint