hasura / hasura/graphql-engine
Auth: Forward custom http headers from auth endpoint (webhook) in the response
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Discussed in https://github.com/hasura/graphql-engine/discussions/8802
Originally posted by **geeksquad87** August 16, 2022
I configured a NodeJs based simple POST Rest API as Authentication Endpoint for Hasura_Graphql_Auth_Hook . In my Auth WebHook endpoint, I am adding a custom header after validating the Authorization header received from original GraphQl Request. (Works fine)
After Authenticating, I am setting a Custom header using (Express).Response.setHeader("MyCustomHeader","MyCustomValue") to the response headers. If I run the POST Authentication Endpoint directly from Postman, I can see the Custom Header in the Response correctly.
However when I run the Hasura Engine GraphQL POST Endpoint configured with POST HTTP Auth Endpoint as Hasura_Graphql_Auth_Hook , the custom header added in the Authentication Endpoint is not received in the final response. I am using Envoy for reverse proxy. I had added logging in Envoy, and I do not see Custom Header in the Envoy Http Filters either.
Any help please ? My end goal is, based on this Custom Header from Auth Web Hook, I want to change the status code in the Final Response using Envoy.
Contributor guide
Assessment
This issue has not been assessed yet.