-
Notifications
You must be signed in to change notification settings - Fork 191
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
Websocket Authentication issues #555
Labels
Comments
clwillingham
changed the title
Authentication with Hasura websocket connection does not work
Websocket Authentication issues
Nov 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
(actually using bun which for the most part has been working, but I have tested through node as well)
Describe the bug
In the current implementation of the Nuxt 3 Apollo module, websocket authentication does not work effectively against Hasura. Hasura expects the headers, including the authorization headers, to be embedded within a headers key in the initial connection_init message. However, the Apollo module configures the websocket link to include the authorization key at the root of the payload key. This discrepancy leads to an authentication failure.
Actual Behavior
The authorization key is being sent at the root payload key, leading to an error with Hasura. The actual payload structure is:
Expected behaviour
The authorization headers should be encapsulated within a headers key to be compatible with Hasura’s expected payload structure. For example:
Reproduction
Additional context
My fork with my own solution is available here: https://github.com/clwillingham/apollo
the fix was simple, I just wrapped the Auth header: v5...clwillingham:apollo:v5
Suggested Solutions:
Enhancing the configurability of connectionParams would cater not only to this specific issue but also provide flexibility for developers to customize the connection_init message as per their requirements, for example, sending the Hasura admin key during early sandbox development.
Logs
No response
The text was updated successfully, but these errors were encountered: