How to access payload's iss on 1.0.0 on validateJwt() ?
See original GitHub issueHello, im new and not used to this library, and im trying to port from djwt 0.9.0 to 1.0.0.
On 0.9.0 i could use validateJwt to get the payload and therefore the iss data stored there as the following:
const data = await validateJwt(
jwt,
secret,
{ isThrowing: false},
);
console.log(data.payload.iss);
but now i can’t, and i can’t find any updated example on the docs.
How can i access the iss data from a decripted jwt token on 1.0.0? Sorry for any inconvenience.
Best regards!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
VerifyJWT policy | Apigee Edge
The JSON-parsable value of a header in the payload. One variable is set for every header in the payload. While you can also...
Read more >Spring Boot security expressions for Auth0 JWT
First issue could be solved by using services like Auth0, they provide user management, access control and authentication libraries for websites ...
Read more >Validate JWT - IBM
Use the Validate JWT security policy to enable the validation of a JSON Web Token (JWT) in a request before allowing access to...
Read more >Using JWT RBAC - Quarkus
Here we inject the JAX-RS SecurityContext to inspect the security state of the call and use a getResponseString() function to populate a response...
Read more >PyJWT 1.0.0 - PyPI
You can still get the payload by setting the verify argument to False. ... in both jwt.encode() and jwt.decode() ("secret" in the examples)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Frenzoid It seems like the validateJwt function had breaking changes rom 0.9.0 to 1.0.0.
Instead of
{ isThrowing: false}
you now need to specify the algorithm{ algorithm: "HS256" }
As the documentation states “The function validateJwt returns a promise. This promise resolves to an object with a union type where the boolean property isValid serves as discriminant.” This means you need to check if the JWT is valid to get access to the payload.
Have a look at issue #25. The suggested solution should fix your problem, too.