-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header decode compatibility issue #2
Comments
Hello @duclm2609, for known algorithms (like EDIT: I think your issue with the java libray is that it accepts the golang one, but this golang jwt library does not accept the java's one because the order is different, right? If that's the case, then the issue is not on the |
On the header decode compatibility issue, the typ header is optional as per the specs. I have a provider which creates JWT without the typ header, and some additional parameters (JWS). Is it possible to make the call to compareHeader optional using a flag? |
I also met this issue when verifying the JWT token which was created by some library in other language. They added some additional keys in that header, and I must not modify the implementation in that library. On my side, I would like to use my custom function to compare header of token, which is done by build-in compareHeader ( Line 159 in 9f23c50
Thanks for your work, it already makes my work more easier! |
Thanks, it is one of nice things in this holiday! I could use it as resetting the public variable |
Thanks @cfeeling, exactly! Happy new year 😊🙌🥳 |
Hello @duclm2609 and @cfeeling. I've just pushed $ go get -u github.com/kataras/jwt@latest which contains new more methods: |
Hi @kataras , I received your message now, but I'm busy recently. I will be back and response ASAP when I was free, thanks for your work. |
Hi @cfeeling no worries, take your time. |
I currently have a problem with header decode. I have 2 services, one in Golang and one in Java. The JWT token is created on Java service using jjwt library (https://github.com/jwtk/jjwt). The header after decode is, for e.g:
{"typ":"JWT","alg":"RS256"}
but currently in this library you are hardcode it as following:which produce output:
{"alg":"RS256","typ":"JWT"}
. Clearly the content are the same but the check is failed since you are compare them byte by byte. I would suggest another check which using map. I can create a pull request if it's possible.Thank you for your great work.
The text was updated successfully, but these errors were encountered: