-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
TMVCEngine.GetCurrentSession ignores TWebSession.IsExpired #355
Comments
SessionTimeout is a fixed value to be added to the time the session was last accessed, whereas with an OAuth controlled session, the "expiry time" is coded into the token and is not related to the last access time. |
The session is just the good-old session mantained with the session cookie. OAuth or JWT "session" is just recreated from the info contained in the token after the token validation. Did I miss something? |
I'm using a TWebSession descendant which stores the OAuth token expiry time and uses that to provide the result in the overridden IsExpired session function. Most places in the code call the IsExpired function but the code I have highlighted does not, so any custom implementation of session expiry is by passed. You mention JWT and OAuth, is there an existing implementation I have missed ? |
DMVCFramework provides a fully compatible JWT implementation out of the box. If you have all the OAuth machinery in place, creating a middleware to support OAuth is a matter of hours using the implementation for JWT provided in the unit |
I do have a custom middleware that supports OAuth. |
It should be fixed (all unit tests pass). Please let me know if works in your case. |
Very nice improvement, many thanks for working with me. |
The class function TMVCEngine.GetCurrentSession ignores the implementation of the IsExpired virtual function in the actual web session item.
Current code at line 2465 is
But this should be
This allows the web session item to determine if the timeout has expired. E.g. when using an OAuth token to determine session lifetime
The text was updated successfully, but these errors were encountered: