Websockets authentication using JWT. #1706
Unanswered
maverick504
asked this question in
Help
Replies: 2 comments
-
Can you show browser dev tools WS request. Is JWT attached in there? |
Beta Was this translation helpful? Give feedback.
0 replies
-
The browser websocket does not support headers, you will need implement a logic to authenticate without use headers, using only packages. https://github.com/whatwg/html/issues/3062 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello world!
I'm struggling with implementing authentication via JWT using websockets.
I'm using Nuxt.js on the front end, specifically, I'm using this template. JWT authentication via HTTP is working fine, and connecting to websockets without the auth middlewares on the backend is working too, but it isn't working when i add the auth middleware.
This is my
wsKernel.js
file (I think maybe i need to add some other middleware or something?):And this is my
socket.js
file:I've tried
auth:jwt
instead ofauth
, but it is still not working...I'm using the
adonis-vue-websocket
package. It uses internally thewithJwtToken
method. This is the code i use on the client to make the connection:Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions