Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 647

Kong request transformer - inject X-User-Id: {{jwt.claim.sub}}

$
0
0

I have a kong api and a apollo-router running behind that. Rather to have all my microservices decrypt a token i want to inject the id after kong has accepted the token. I use oauth2 and I use openID as a plugin and it works. The token has a sub and the token is valid. But when i try to add in the request transformer, heading: X-User-Id: {{jwt.claim.sub}} i just get that out on the other side. So it looks like Kong don´t add in the information i want. So my system is plugin OpenID and then the request transformer with this as the "add header" X-User-Id: {{jwt.claim.sub}}. I do not use customer or customer group because i want this to be injected in every user so i dont need to decrypt every token. I just need the ID of the user available so the backend microservice now witch user that asks. Maybe someone here knows what i need to add to the add header, because this want work.

I have read the docs, tried different plugins - i have tested other commands, i have decrypted the token and the sub information is available. So now I am trying here.


Viewing all articles
Browse latest Browse all 647

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>