Skip to content

Illegal base64 character 2d #721

Open
@gyjx

Description

@gyjx

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions