-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[feature] JWT - Send payload as headers to upstream server #1985
Comments
imo this should be done in a dual-plugin approach:
see also; #550 (comment). Much of the application logic can be shared this way. |
@pouledodue I have done a proof of concept here: You also need to account for requests that already have those headers set. You may could remove them with a request transformer before the jwt-claims-header executes. This comes with no support :) |
@wshirey I will try it tomorrow |
This feature would be very nice indeed. However, passing the payload, as mentioned, in a "X-JWT-Payload" header would be enough. This gives the opportunity to parse the JSON on API / Microservice level, in contrast to hardcoding headers based on what the payload contains. |
agree with @jovanmaric, a base64 encoded payload in a custom http header might be enough? no need to populate one http header for every key in the payload |
yes would be enough |
Any update on that? Do you plan to integrate this feature in kong? |
If anyone gets here, I've written a plugin that does exactly this https://github.com/vnwonah/kong-token-to-header-extractor |
Summary
I use JWT plugin.
I craft all my JWT tokens using 1 single Consumer named 'auth-server'
The end-user email is encoded in the JWT payload.
I want my upstream server to receive the end-user email as Header.
example:
Use case
The text was updated successfully, but these errors were encountered: