websocket client basic authentication #2227
-
I didn't find any information how the websocket client basic authentication is working ? for the http this works without any problem:
But for websocket for example using wscat :
doesn't work ! any hints are welcome |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
There is no authentication in WS but in HTTP mongoose/examples/device-dashboard/net.c Lines 223 to 225 in b379816 mongoose/examples/device-dashboard/net.c Lines 263 to 265 in b379816 |
Beta Was this translation helpful? Give feedback.
-
@embetrix I've noticed you're using digest auth in curl argument. Mongoose can do basic auth, not digest. Mongoose has function "creds" that fetches user and password from Authorization header and Cookie (access_token): mongoose/examples/device-dashboard/net.c Lines 113 to 114 in 7f3d450 |
Beta Was this translation helpful? Give feedback.
There is no authentication in WS but in HTTP
It is you who has to write the code to check for authentication and upgrade the connection to WS after authenticating the URL.
https://mongoose.ws/documentation/tutorials/device-dashboard/
mongoose/examples/device-dashboard/net.c
Lines 223 to 225 in b379816
mongoose/examples/device-dashboard/net.c
Lines 263 to 265 in b379816