Skip to content

fix: skip unsupported keys when loading JWK set in IdTokenVerifier - #1176

Open
arib06 wants to merge 1 commit into
googleapis:mainfrom
arib06:idtokenverifier-skip-unsupported-keys
Open

arib06 wants to merge 1 commit into
googleapis:mainfrom
arib06:idtokenverifier-skip-unsupported-keys

Conversation

@arib06

@arib06 arib06 commented Oct 9, 2026

Copy link
Copy Markdown

skip keys without a supported algorithm (RS256/ES256) or without a kid when loading a JWK set, so a single unsupported key no longer aborts the whole set with a NullPointerException from ImmutableMap and fails verification of validly signed tokens from that issuer.

PublicKeyLoader.buildPublicKey returns null for an unsupported algorithm and kid is optional per RFC 7517, but the loop that builds the key cache catches only the key-factory exceptions, not the ImmutableMap.Builder.put(null) NPE, so one unusable key in an otherwise valid key set defeats the existing skip-bad-key handling.

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@arib06
arib06 requested review from a team as code owners October 9, 2026 08:33
@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label Oct 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant