You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rigth now, I have my own implementation of a JWT with its own Header and Payload class. But, I am struggling with signing, decoding and verifying the JWT so I have decided to use an external library like this one. As I said, I already have my own payload (and it is kind of extensive), it has a lot of keys and values. Some of them are JSONObjects so if I want to use this library I just can't initialize JWTCreator because I don't have the function withClaim(String name, Object value) in this file.
So, it is a reason for this? I suggest create a new method similar to withHeader but for the payload.
Maybe there is another solution that I don't know so this change is unnecessary.
If you think this is a good idea, I am up to make the change and create the tests
The text was updated successfully, but these errors were encountered:
I'm struggling with the same problem. I read my own Payload from a json file and I have a lot of keys and values. I was looking for an approach with a map, but there is no way to pass a map to the claims without setting a "name" to that...
Thanks for the request, I think this makes sense to add.
We've added this to our backlog, to add a method withPayload that accepts of a map of claim names -> values. In the meantime, would be happy to review or discuss specifics if someone is interested in making a PR. We'll need to ensure that we're consistent with how we validate the claims (non-null claim name, valid object types for serialization purposes, etc), and verify/document behavior if calling this new method and the other withClaim methods.
jimmyjames
added
feature request
A feature has been asked for or suggested by the community
and removed
needs investigation
An issue that has more questions to answer or otherwise needs work to fully understand the issue
labels
Feb 19, 2021
Description
Rigth now, I have my own implementation of a JWT with its own Header and Payload class. But, I am struggling with signing, decoding and verifying the JWT so I have decided to use an external library like this one. As I said, I already have my own payload (and it is kind of extensive), it has a lot of keys and values. Some of them are JSONObjects so if I want to use this library I just can't initialize JWTCreator because I don't have the function withClaim(String name, Object value) in this file.
So, it is a reason for this? I suggest create a new method similar to withHeader but for the payload.
Maybe there is another solution that I don't know so this change is unnecessary.
If you think this is a good idea, I am up to make the change and create the tests
The text was updated successfully, but these errors were encountered: