-
Notifications
You must be signed in to change notification settings - Fork 154
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
Propagating Downstream Response Headers (set-cookie) to the Wundergraph Reponse #385
Comments
What are your thoughts on this: The "Set-Cookie" request comes back. This X-Cookie will never be set from a client request, so we don't send it to the origin. All of this means that cookies for this never need to get back to the client. What are your thoughts? |
Hey Jens, a few issues with this in my eyes:
Is the issue here that only returning the body and not the response headers is supported in the |
No, it's not an issue. I'm just trying to find the best possible solution. |
We're not using Wundergraph authentication right now. You're correct with the later point, authentication would solely be handled by the origin service. Wundergraph would just needs to pass on the |
Let me know your thoughts on this one: #389 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Problem
Hi Wundergraph! Our downstream client uses cookie based authentication where, on a successful login mutation, they pass a set-cookie header in the response with the auth token.
With this flow, we would need to pass this header upto the client but I'm not seeing anywhere to do this. With request headers it's simple as we can specify to pass them in the introspect.graphql options but there's no option for response headers.
My other thought was to hook into the originResponse however I'm not sure how I can use this hook to mutate the final response.
Can this be done?
Suggested solution
Similar to passing request headers in the graphql introspection, can we also add response headers in the same section? There's complications to this due to a Wundergraph query potentially making multiple requests to the downstream api. We could add an enum with values of
collate
andoverwrite
so that the former would add all the values of the header in question to a comma-delimited string whilst the latter just chooses the last value set. Not too much thought has gone into the above though so there might be stumbling blocks.Additional context
My downstream response headers:
The response headers on the Wundergraph response:
The text was updated successfully, but these errors were encountered: