简体   繁体   中英

How can i access the jwt token payload

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM