Skip to content

Conversation

saurabhgangal
Copy link

@saurabhgangal saurabhgangal commented May 21, 2025

I've replaced org.springframework.security.jwt with com.nimbusds.nimbus-jose-jwt (version 10.3).

The org.springframework.security.jwt library does not correctly handle tokens with typ="at+jwt". nimbus-jose-jwt is a more robust library for handling various JWT/JOSE specifications and provides the necessary functionality.

Changes include:

  • I updated pom.xml to swap the JWT library dependencies.
  • I refactored JwtTokenVerifierBuilder.java, OAuth2DataAccessTokenServiceImpl.java, and OAuth2TokenAuthenticationProvider.java to use the Nimbus library for JWT parsing, signature verification (via JWKS), and claims extraction.

Your existing tests are expected to cover this change as it's primarily a library replacement for underlying token processing.

Fix # (see https://help.github.com/en/articles/closing-issues-using-keywords)

Checks

Any screenshots or GIFs?

If this is a new visual feature please add a before/after screenshot or gif
here with e.g. Giphy CAPTURE or Peek

Notify reviewers

Read our Pull request merging
policy
. It can help to figure out who worked on the
file before you. Please use git blame <filename> to determine that
and notify them either through slack or by assigning them as a reviewer on the PR

google-labs-jules bot and others added 2 commits May 21, 2025 03:53
I've replaced `org.springframework.security.jwt` with `com.nimbusds.nimbus-jose-jwt` (version 10.3).

The `org.springframework.security.jwt` library does not correctly handle
tokens with `typ="at+jwt"`. `nimbus-jose-jwt` is a more robust library
for handling various JWT/JOSE specifications and provides the necessary
functionality.

Changes include:
- I updated `pom.xml` to swap the JWT library dependencies.
- I refactored `JwtTokenVerifierBuilder.java`, `OAuth2DataAccessTokenServiceImpl.java`,
  and `OAuth2TokenAuthenticationProvider.java` to use the Nimbus library
  for JWT parsing, signature verification (via JWKS), and claims extraction.

Your existing tests are expected to cover this change as it's primarily a
library replacement for underlying token processing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant