jose4j the reverse of the JSONAware

54 Views Asked by At

I have used the brilliant JSONAware interface (with the method toJSONString) on jose4j so that I can add a complex JSON structure under a single claim - it generates just what I wanted the JWT to look like.

However now I'm trying to extract the same claim from the JWT, and there seems no built in way to reverse it. I was hoping for another interface (or a method on the same interface) with a method called fromJSONString or something that I could call with:

getClaimValue(String, JSONAwareImpl.class)

that then returned the class (my using the implementation of the method).

Any ideas on this? At the moment my only solution is to get the entire JWT in raw format and parse the entire thing to extract just my claim. It just seemed a little strange to be able to go one way and not back the other way, and wondered if I have just missed something?

Thanks.

0

There are 0 best solutions below