Open jpetitcolas opened 4 years ago
@jpetitcolas,
Hasura Auth Webhook in POST request mode will send the headers in the body of the request. https://docs.hasura.io/1.0/graphql/manual/auth/authentication/webhook.html#post-request
I have the same problem. I want to pass my http only cookies to my webhook api. I use post and read the payload. Any guesses? Should this work?
Edit: Since it is stored inside the body - it looks like this will not work with a http only cookie.
I have the same problem. I want to pass my http only cookies to my webhook api. I use post and read the payload. Any guesses? Should this work?
Edit: Since it is stored inside the body - it looks like this will not work with a http only cookie.
HTTP only cookie will be sent to the action webhook, you just need to enable forward headers on the action modify tab. Also make sure that the action is of type mutation since query type doesn't seem to work/
@mackarelfish This issue is in reference to authentication webooks, not action webhooks. AFAIU they behave quite differently.
Is this still an issue? I am examining using http-only cookies to send a token to hasura and read it, but it's looking here like that might not be an option?
I am currently struggling with authentication hook. I have some HTTP-only cookies containing my access token. As Hasura doesn't support token from cookies, but only
Authorization
header, I planned to set up an hook to read cookies and return data required by Hasura (user ID and role).Testing my auth hook independently works:
Yet, if I test with my Hasura endpoint, I can see in the logs:
I got an error from webhook:
It looks like the cookies are not transferred between GraphQL Engine and auth hook. My auth code is the following (running on AWS Lambda):
It works locally, but not once deployed.
Is there any restrictions for passing cookies? How can I debug the request to the auth hook? I tried using the
debug
log level, in vain. And I never read any Haskell before, reducing a little bit my understanding of current code base. :)