- changed status to invalid
JWTClaimsSet.Builder.claim does not preserve JSONObjects in arrays
Issue #327
invalid
Hello,
if i have the following code,
JSONArray array=new JSONArray();
JSONObject entry=new JSONObject("{entry1:1}");
array.put(entry);
String claims=new JWTClaimSet.Builder().claim("key",array).build().toString()
the resulting claims do not contain the object "{entry1:1}"
I’ve found no documentation on this specific behaviour and since I have used only JSON entities as indicated in the doc; it seems like a bug to me
Comments (4)
-
-
reporter Hello,
Thanks for your answer. I’m aware that in my example I can use JSONObject.put(key,value) for the same expected result. But I’m given a JWTClaimsSet.Builder, the other party expecting that I can add my data with the method claim(key,value). Are limitations expected for this method? Where can I find them?
-
Well, you can always use a JWSObject with Payload that is your own serialised JSON object.
SignedJWT inherits from JWSObject.
-
reporter Will try. Thank you
- Log in to comment
Use
new JSONObject().put("key", value);