WebSocket Authentication and Authorization

  Рет қаралды 17,911

Covalence

Covalence

Күн бұрын

Пікірлер: 14
@weeta34
@weeta34 8 ай бұрын
Hello, thank you. fyi, starting @types/ws 8.5.5, isAlive property is not recognized.
@andresmartinez-losa5779
@andresmartinez-losa5779 7 ай бұрын
Grear tutorial! How would you authenticate with digest? Thx
@dashaxedit
@dashaxedit Жыл бұрын
Very cool. Thank you very much
@laveshsaluja9478
@laveshsaluja9478 11 ай бұрын
while send headers to ws the req.headers.authorization is undefined even after sending the authToken?
@covalence-io
@covalence-io 11 ай бұрын
you can't use req.headers for websocket auth... that's kind of the whole point of the video. if you watch we put the token in the websocket url itself if using an access token ;)
@asldkfjalsdkjflaskjdfl
@asldkfjalsdkjflaskjdfl Жыл бұрын
Hi, cool video, but I got a couple of questions: what should I do if token refreshes during the socket connection how token should be updated for opened connection properly? should I close the connection and open it again? should I develop protocol, that sends an event with new token to the server? and also I'm quite interested in how synchronizatino process should be done, if I got connection loss for some period of time I'd appreciate if someone answer at least on a couple of questions
@covalence-io
@covalence-io Жыл бұрын
typically the authorization is done when the connection is opened... and then once it's opened you don't need to worry about it refreshing... the connection will simply remain opened until it's not. If it's closed you can handle authorization again but attempting to reopen the connection and if auth fails you may need to refresh the token. Performing synchronization well can be tough and usually involves reopening the connection while also making an api call to request past data as well and then manually adding missed data if applicable
@asldkfjalsdkjflaskjdfl
@asldkfjalsdkjflaskjdfl Жыл бұрын
@covalence-io thank you a lot, I tried what you suggested and it works much better, then it was in my initial implementation with sending authorization token on every token refresh
@ashokchandra4911
@ashokchandra4911 Жыл бұрын
How to authenticate with traccar web socket api and get real time data please help
@covalence-io
@covalence-io Жыл бұрын
Never used traccar but happy to look into it! Their documentation is a good starting point though ;) www.traccar.org/documentation/
@Samsul2013
@Samsul2013 Жыл бұрын
can you do the same websocket auth using vanilla javascript instead of typescript?
@covalence-io
@covalence-io Жыл бұрын
The code is very similar... almost identical. You can change import statements to require statements and remove all types and you should be good to go!
@sabinbaral4132
@sabinbaral4132 Жыл бұрын
👏
Routing Your WebSockets!
26:16
Covalence
Рет қаралды 2,6 М.
JWT - JSON Web Token Crash Course (NodeJS & Postgres)
57:01
Hussein Nasser
Рет қаралды 46 М.
Motorbike Smashes Into Porsche! 😱
00:15
Caters Clips
Рет қаралды 23 МЛН
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,7 МЛН
Snowflake
1:17:52
Jignesh Patel
Рет қаралды 866
JWT Authentication Tutorial - Node.js
27:36
Web Dev Simplified
Рет қаралды 1 МЛН
Coding a Simple WebSocket Server in Node.js that Scales!
33:25
How to scale WebSockets to millions of connections
14:01
Ably Realtime
Рет қаралды 30 М.
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 257 М.
WebSockets Crash Course - Handshake, Use-cases, Pros & Cons and more
47:33