-
Notifications
You must be signed in to change notification settings - Fork 44
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
It is not possible to get the claims and the JWT parameters without verify #5
Comments
Hi @Ostico I think you're asking for how to decode the JWT w/out validation? In addition to your example code, you can also use this method:
This is using the varargs version of the
Using this method, when Let me know if I haven't answered your question. |
Hi @robotdan , i already tried without verifiers, but i get an exception:
From the code it seems that is not possible decode a JWT when parts.lenght != 2:
even if private JWT validate(String encodedJWT, String[] parts, Header header, Verifier verifier, boolean allowNoneAlgorithm) {
...
} |
Ah, ok, I see what you mean. Yeah, you're correct, we don't offer a way to decode the JWT w/out verification (at least not easily). Would it help if I added a utility method to decode the payload? Would you also want the header? For example, something like :
This method would not perform any validation, it would only read the JSON and return a JWT object. This would more/less do the same thing you're doing already:
|
See commit 4e5d4d0, added |
Yes, it is perfect. The header is not so important in my opinion. |
Great, thanks for the feedback. I also added |
A verifier is mandatory to get the access to the JWT fields, but if i'm in the client side and i want read informations from JWT is not possibile decode the payload without verification:
some helpers could be useful.
The text was updated successfully, but these errors were encountered: