I have various microservices, and i am usign jwt policy to authenticate the user in express gateway, but i need to access the token payload, and proxy the payload to my microservice. I have tried to acces the payload in req.user, but is nothing there. Is there a way to access the payload?. thaks
Asked
Active
Viewed 428 times
0
-
This is odd. The payload should indeed be in the `req.user` object. – Vincenzo Oct 20 '18 at 19:25
1 Answers
1
When Express Gateway receives the JWT, it will verify its signature but it won't forward its content by default.
Instead, it will extract some of the contents and put these as headers that your service can then read and do the stuff you need.
In case you need a particular field, you can use the header policy to put these into the final request object.

Vincenzo
- 1,549
- 1
- 9
- 17