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

The behavior using 'json' differs from 'multi_json' #41

Closed
Foxandxss opened this issue May 25, 2014 · 1 comment
Closed

The behavior using 'json' differs from 'multi_json' #41

Foxandxss opened this issue May 25, 2014 · 1 comment

Comments

@Foxandxss
Copy link

Having in mind I just started with JWT a while ago, I see a difference between the two.

Back on node, I could save a simple integer as payload or even a string.

Here, I can do that also if I have multi_json but if not, it raises an exception so I am forced to save a hash.

It is not that important but it bugged me a while.

What do you think?

@yolk
Copy link

yolk commented Nov 21, 2014

According to the current Draft the payload must (or even MUST!?) be an object:

JWTs represent a set of claims as a JSON object that is encoded in a
JWS and/or JWE structure. This JSON object is the JWT Claims Set. As
per Section 4 of RFC 7159 [RFC7159], the JSON object consists of zero
or more name/value pairs (or members), where the names are strings
and the values are arbitrary JSON values.

So I guess JSON is correct and MultiJSON/node are not. ruby-jwt should maybe even throw an exception on .encode in this case.

@excpt excpt closed this as completed Feb 25, 2015
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

3 participants