Closed josemf closed 5 years ago
Hey,
req.egContext
object and then use the Request Transformer to add the required values as headers and remove the one that are not necessary. In this way you'll leverage EG's stuff and not reinvent the wheel.
Hey Vincent,
Thank you!
I've a custom policy for JWT authorization and I'm trying to modify the Authorization header so headers send to proxy include said Authorization header.
Flow: App -> Sends request with JWT Authentication: Bearer xxxxx Gateway Custom Policy -> call web service for JWT token authorization, changes header Authorization: apiKey yyyyyy (provided by the web service) Gateway Proxy -> proxies to service endpoint that expects header Authorization: apiKey yyyyy schema Service Endpoint API -> reads header Authorization: apiKey yyyyy
Policy
gateway.config.yml
I've based some of the code in the Request Transformer code
https://github.com/ExpressGateway/express-gateway/tree/master/lib/policies/request-transformer
. For some reason request header deletion is not working...Also is there a way to modify an existing request header?