-
Notifications
You must be signed in to change notification settings - Fork 996
Parase with claims failed. signature is invalid #272
Comments
The character set used by tokens should be the same in most US based encodings. I'd use UTF8 where you can, but this is unlikely to be why your token didn't verify. It's difficult to be helpful without more information, though. |
I'm going to close this ticket. If you'd like to share an example, I might be able to be more helpful. Please make sure you don't use any real secrets when creating examples. |
For example,the key is ’whatthefuck‘,and The token I got was ‘eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE1Mjk0NTk4OTU1MDAsImlzcyI6ImRvdWJsZXMiLCJleHAiOjE1MzA0NTk4OTY1MDB9.1EADHewsDi0rX4nNDZ2WEwVrGn_Nfn0m954b9OoiXuY’ through java(jar is io.jsonwebtoken.jjwt 0.9.0),but this token cannot be parsed through go。The Error message is parase with claims failed. signature is invalid。 |
I have solved this problem!Convert key from string to byte requires base64.URLEncoding.DecodeString(key) instead of []byte(key), and then it can be resolved successfully. |
This worked for me too. Had to do it both on the encoding and decoding side. |
error is |
Why i new a token by java,and i parse it by golang,then told me ‘parase with claims failed. signature is invalid’?I fount java string to bytes use us-ascii ,but golang use RFC 4648,Is this a problem?How can I solve it?
The text was updated successfully, but these errors were encountered: