Skip to content
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

Signature value should not be converted to hex string #10

Open
paweldomas opened this issue Jul 29, 2016 · 0 comments
Open

Signature value should not be converted to hex string #10

paweldomas opened this issue Jul 29, 2016 · 0 comments

Comments

@paweldomas
Copy link

paweldomas commented Jul 29, 2016

According to the rfc7515 the result of hash function(signature) should not be converted to hash string, but only BASE64URL encoded:

Computing the HMAC of the JWS Signing Input ASCII(BASE64URL(UTF8(JWS
Protected Header)) || '.' || BASE64URL(JWS Payload)) with the HMAC
SHA-256 algorithm using the key specified in Appendix A.1 and
base64url-encoding the result yields this BASE64URL(JWS Signature)
value:

dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk

Currently the library is not interoperable with other JWT libraries(see results with debugger at https://jwt.io). The tests should be probably changed to compare raw values instead of working with the values computed by the library's encode function:

https://github.com/Olivine-Labs/lua-jwt/blob/master/spec/jwt_spec.lua#L40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant