-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoded JWT is not being saved in req.user when verified #972
Comments
I have the same problem, I don't know if it's a bug or not but can't figure it out. |
After hours of hair pulling, I found this link policies:
-
jwt:
action:
secretOrPublicKey: theKEY
checkCredentialExistence: false
-
request-transformer:
action:
body:
add:
user: req.user |
This is on purpose. Express Gateway will never touch your request body — if you need to forward it somehow you need effectively to use the request transformed to add is as an header or in the body — that is really up to you. The issue here pointed out is different though — he's complaining that |
The fact that this is on purpose totally make sense. Actually everything about express gateway make sense. I'm sorry that I didn't understand the actual problem @deviant32 has mentioned (to be fair, the post doesn't talk about being null). |
[x] Bug
JWT Policy is validating the JWT correctly, however the user in req.user is not being created. I am running the latest version.
JWT:
{ "sub": "1234567890", "name": "John Doe", "admin": "true", }
gateway config:
policies: - jwt: - action: secretOrPublicKey: secret checkCredentialExistence: false - proxy: - action: serviceEndpoint: endpoint
The text was updated successfully, but these errors were encountered: