-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Handle remember me using JWT (setting dynamic expiration time) #495
Comments
That would be handled by the Identity Provider ? |
This is the comment from Facebook Group related to this issue Hi guys. Currently using the JWT middleware that is not possibile. The change to make it possibile is really easy and I'm planning to do it ASAP without breaking things for the projects already using JWT middleware (retrocompatibility is a must). We'll use this issue to track changes about this |
@MPannier please, check the sample |
It works for me. I can set an ExpirationTime depending on a given parameter. Thank You. But I think that is not all. How can we handle a logout? I know it is not really possible with jwt because it is only available on the client side. But if a user login with rememberme and will explicitly logout I would like to add the jwt to some kind of blacklist. And if an attacker has stolen the token, but the user called logout, I will prevent the usage of this jw token. I think we also need a logout url which we can catch the token and save it. And we also need a procedure/event in the login process to check if the given token is blocked or something else. |
Nice to know that this fix your issue.
It is quite simple. I'll think about it ASAP. If you want to contribute, you are welcomed. |
I'm not sure where to add these two new events or to create a new middleware for this kind of functionality. If You think about this topic and will be providing a solution in the near future is quite enough for me. |
Good, let me think about the architecture from the user POV and I'll back to you with a possibile approach to discuss |
Advantage of JWT is to not keep sessions on the server. Having such middleware will force us to synchronize blacklisted tokens between nodes that is actually similar to keep synchronized sessions. |
@iliauta this mechanism is a common pattern used with jwt when you need to handle some premature expiration. |
Hello, is there a way to handle "remember me" with JWT in DMVC Framework? Is it possible to "hook" into the creation of the JWT to set a longer ExpirationTime if the user calls "login" with an additional flag "rememberme": "true" or something like that?
The text was updated successfully, but these errors were encountered: