Skip to content

Conversation

@ziqin
Copy link

@ziqin ziqin commented Dec 5, 2025

This PR fixes gh-18269 by passing a constant string "JWT" to JwsHeader.Builder::type(String type).

I am not sure whether it affects compatibility with the existing support for RFC 9068, e.g., the JwtValidators.AtJwtBuilder.

ziqin added 2 commits December 5, 2025 21:18
This test encodes an JWT with NimbusJwtEncoder, and then decodes it with
NimbusJwtDecoder.

This test will fail when NimbusJwtEncoder emits a JWT with a wrong `typ'
parameter in the header, as NimbusJwtDecoder validates the JWT with
JwtTypeValidator by default.  It may be beneficial for finding out other
similiar bugs too.

Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
Closes spring-projectsgh-18269

Signed-off-by: Ziqin Wang <ziqin@wangziqin.net>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 5, 2025
@ziqin ziqin marked this pull request as ready for review December 5, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NimbusJwtEncoder produces JWT with wrong "typ" header value

2 participants