Answered question

javascript to Decode JWT token

i have a jwt token as one of the api response and can extract it. once its decoded, i will received a userID which needs to be used in subsequent calls. this UserID is not available directly as a value in any of the reponses and token needs to be decoded to fetch this value.

deepti V.
deepti V.

deepti V.

Level
0
21 / 100
points
Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

Did you find this useful ?

No (0)

Yes (1)

100%

100% of users found this answer useful

Other answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

The JWT values contain 3 different parts separated by a dot. The first part is the header that contains the signing algorithm used and the second part is your payload that may contain your userID. The third part is the signature. Since they are Base64 encoded you can import a Base64 JS library in NeoLoad and decode the content of the second part.

deepti V.
deepti V.

deepti V.

Level
0
21 / 100
points

@nouredine thanks for the inputs.
Does neoload have a list of such libraries which i can add and use ?
or how do i get the common libraries to import directly in neoload?

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

NeoLoad does not embed a Base64 library so you need to import your own library from the menu Edit-->JS Libraries