Skip to content

Only One Valid WebSocket Session #991

Answered by Benehiko
ShawnCZek asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ShawnCZek

Not unless you write some custom logic - sort of like a locking mechanism - which denies the number of "active" sessions a user is allowed to have. This could be done on your application layer since you can use the user id (which is unique) from the session cookie to manage this. But Oathkeeper only checks if the cookie is valid or not.

You could most likely also wrap Kratos' /sessions/whoami in a small service which does this logic and tells Oathkeer to proceed or not.
https://www.ory.sh/docs/oathkeeper/pipeline/authn#cookie_session

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ShawnCZek
Comment options

Answer selected by ShawnCZek
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