java-jwt icon indicating copy to clipboard operation
java-jwt copied to clipboard

Illegal base64 character 2d

Open gyjx opened this issue 9 months ago • 0 comments

Checklist

  • [x] I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • [x] I have looked into the API documentation and have not found a suitable solution or answer.
  • [x] I have searched the issues and have not found a suitable solution or answer.
  • [x] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [x] I agree to the terms within the Auth0 Code of Conduct.

Description

version:3.10.3

String token = JWT.create() .withClaim(USER_ID, userId) .withClaim(USER_NAME, userName) .withExpiresAt(DateUtils.plusDays(120)) .sign(algorithm);

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6IuWImOS9s-S9syIsImV4cCI6MTc1NTMxNzA1MSwidXNlcklkIjo1Nn0.fB3ruBQKpCJLrQA8daopb1c1IwJGpHHb9FgRPObA_I0

String result = new String(Base64.getDecoder().decode("eyJ1c2VyTmFtZSI6IuWImOS9s-S9syIsImV4cCI6MTc1NTMxNzA1MSwidXNlcklkIjo1Nn0"));

error:

Illegal base64 character 2d

Reproduction

1

Additional context

No response

java-jwt version

3.10.3

Java version

jdk1.8.0_351

gyjx avatar Apr 18 '25 04:04 gyjx