We are implementing a new service which requires Authorisation by the way of a JWT.
I already have the submission and returned body containing the "access_token"
My question is how do I set up a call to decode the JWT (I have the following from a google search:)
function jwt_decode(JWT) { var parts = JWT.split('.'); // header, payload, signature return JSON.parse(atob(parts1)); }
Once I have it decoded I then need to test that the relevant information is contained within.
I think I will need an environment/user file to store some variables but I'm not sure what I would need to store.
I currently have a "POST" to generate the "access_token", but not sure what to do next. Do I need a "GET" to decode the JWT? What Authorisation do I need?
EDIT
So I've got my "access token" into an environment variable. What I want to do now is decode the Access token and split it out so that I can confirm (Create Tests) the individual results in the Payload
Any comments or suggestions would be appreciated. Can I do that within the same Post Call in postman, does it need a separate "POST" or "GET". I'm a QA with little Javascript (if that's what Postman uses for testing) experience so please be clear in any replies. Thanks