Skip to content

Incompatibility with the latest version of jjwt #1724

@PierreBtz

Description

@PierreBtz

Describe the bug

When using the latest version of jjwt (0.12.x) to handle authentication with a JWT token, I observe the following issue:

java.lang.NoSuchMethodError: 'io.jsonwebtoken.JwtBuilder io.jsonwebtoken.JwtBuilder.setIssuedAt(java.util.Date)'

To Reproduce

I created the following reproducer: https://github.com/PierreBtz/jwt-github-bug.
A unit test shows the issue, using an older version of jjwt the test is GREEN, using the latest 0.12.(x), the test is RED (see README for setup details).

Expected behavior

Jwt works properly.

Desktop (please complete the following information):

  • OS: OsX Ventura 13.6
  • Browser N/A
  • Version N/A

Additional context

The root cause seems to be jwtk/jjwt#794 which deprecated a bunch of setters.
An evident fix would be to modify the code to use the new setters instead of the old deprecated one, and I'm happy to provide a PR for this however:

  1. I don't understand why a deprecated method wouldn't work anymore :/
  2. If we start using the new setters, it will be a breaking change forcing folks to update jjwt to 0.12.x.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions