Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add authentication check on subsequent web socket messages #15

Open
Zerim opened this issue Dec 5, 2017 · 1 comment
Open

Add authentication check on subsequent web socket messages #15

Zerim opened this issue Dec 5, 2017 · 1 comment

Comments

@Zerim
Copy link
Contributor

Zerim commented Dec 5, 2017

Currently we only run the UserFromAuthToken function when the WS connection is initialized. We should run it on subsequent messages as well in case the auth token expires, etc.

Can leave it up to the user to decide if they want to memoize etc. to keep that function call inexpensive.

@Jannis
Copy link
Contributor

Jannis commented Dec 6, 2017

An alternative approach could be to give developers a way to invalidate the user from the outside whenever they want.

The reasoning here is that the lifetime of a token is application-specific, so the application could set up a timeout that matches the expiration time and then invalidate the user (optionally closing theconnection too).

Another reason where this could be useful is that data changes in the application (e.g. a change ot the user) may invalidate the token. So the application can reevaluate the token when this data changes and decide to invalidate it if necessary.

Giving applications this control may be better (and more obvious) than reevaluating the token unnecessarily often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants