Skip to content

Questions re: authentication and credential refresh #292

Answered by enisdenjo
spencerwilson asked this question in Q&A
Discussion options

You must be logged in to vote

Since WebSocket connections cannot be hijacked, I personally don't bother much. I know for a fact that the identity resolved during the connection initialization process is persisted as long as the connection is alive - so, re-authenticating within an active connection is kinda useless if you ask me.

Of course, there are cases where you want to kick the client off - like when the user gets his rights revoked while being connected - but, these cases can be solved differently: keep a map of all user IDs with connected sockets and simply close the socket behind a user ID whenever he's deemed unauthorized.

Additionally, if you worry about connections being alive for too long, simply set a lim…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@spencerwilson
Comment options

@enisdenjo
Comment options

Answer selected by spencerwilson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #291 on December 23, 2021 16:45.