I Have examined the endpoints, but the project is based on a micro-services architecture, i.e. the JWT token or authorization changes severely whenever someone logs on to the server.

So the token I have extracted from the USER CONTROLLE R(Authentication API), when I am passing that token with further requests, it is showing error 401 or authorization failed.

SO what should I do to configure some request sampler that every time when the test runs it fetches the current JWT TOKEN and test runs successfully?

1 Answer 1


Looking into Introduction to JSON Web Tokens article, the tokens have

exp (expiration time)

I don't think you should be obtaining a new JWT token for each and every request, my expectation is that you need to do this only once, via i.e. Once Only Controller and refresh it only if your test duration exceeds the token life span.

You can inspect JWT token attributes using i.e. https://jwt.io/ website

I would also suggest double-checking that the token is properly extracted from the USER CONTROLLER and added to the next request, it can be done using Debug Sampler and View Results Tree listener combination.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.