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

Is it possible to decode the payload without validating the signature? #97

Closed
krzkrzkrz opened this issue Aug 6, 2015 · 2 comments
Closed

Comments

@krzkrzkrz
Copy link

Is it possible to decode the payload without validating the signature?

c="eyJpZCI6MSwidHlwZSI6Im1hbmFnZW1lbnQiLCJpYXQiOiIyMDE1LTA4LTA2VDE1OjA3OjEyLjM3MFoiLCJleHAiOjE0MzkxMzI4MzJ9"

Base64.decode64(c)
"{\"id\":1,\"type\":\"management\",\"iat\":\"2015-08-06T15:07:12.370Z\",\"exp\":1439132832}"

I tried using the Base64 lib, but it returns the result in an escaped formatted string

@aj-michael
Copy link
Member

Yes. As discussed in the README, the third (optional) parameter of ::JWT.decode is a boolean that is whether or not to check validation. It will typically look like this:

claims, header = JWT.decode(raw_jwt_token, nil, false)

If you think the README is not descriptive enough of this matter, please send a pull request that addresses what part confused you.

@krzkrzkrz
Copy link
Author

Ahhh, README is fine. I must have missed it. 4am here. Closing for now. Thanks

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

2 participants