Skip to content

No SignatureException when token ends with non base64 alphabet #520

Closed
@celloni

Description

@celloni

Hey all

I work with Version: 0.10.7

I don't understand a behaviour of the lib. So I have the following:

Code to parse a token:

            Jwts.parser()
                    .setSigningKey(jwtSecretKey.toByteArray())
                    .parseClaimsJws(token)
                    .body

JWT Token ends for example with a non base64 alphabet sign } for example like:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c{

Like this the JWT signature of the Token is not encoded correctly so I would expect an SignatureException but the lib extracts the token correctly, so what happens here with the trailing}?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions