CXF-9032 - Fix JWS verification with a "jwk" key store - #3531
Merged
Merged
Conversation
ffang
approved these changes
Sep 30, 2026
coheigea
added a commit
that referenced
this pull request
Sep 30, 2026
(cherry picked from commit e2ff6c9)
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.
Two problems in JwsUtils.loadSignatureVerifier when
rs.security.keystore.type is "jwk":
to load a Java KeyStore of type "jwk" to resolve the certificate,
which fails ("jwk KeyStore not available"). Tokens from Microsoft
Entra ID, which carry x5t, could therefore never be verified. These
headers are now ignored for a jwk key store and the verification key
is loaded from the configured JWK set.
JWK set if rs.security.accept.public.key was enabled, a flag that
also allows a JWK embedded in the token to be trusted. Without it, a
key set holding several keys, such as an identity provider's JWKS,
could not be used, and keys could not be rotated.
When no rs.security.keystore.alias is configured, the kid now selects
the key from the JWK set, provided the key is explicitly marked for
signatures ("use": "sig", or key_ops containing "verify"). Otherwise
the previous behaviour applies:
To follow an identity provider's key rotation, configure a jwk key
store pointing at its JWKS URL and no alias. Note that a valid
signature from a shared JWKS does not mean the token was issued for
this service: claims such as iss and aud must still be validated.