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

Use SessionExpirationUtils for validate user and client sessions. Check client session is valid in TokenManager. #29013

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rmartinc
Copy link
Contributor

Closes #24936

This PR checks the client session in the token manager to not manage a expired client session that generates negative values. Besides I have also unified the AuthenticationManager.isSessionValid to also use SessionExpirationUtils calculations. I'm sending a draft because of the last change. This is modifying some tests because previously the isSessionValid used just the remember-me values when the session was remember-me. Now it uses teh max value between the remember-me value and the normal sso value (as SessionExpirationUtils does). I think we should add a little upgrade note if we decide to continue this way. There are other two options: continue doing the calculation like before; change calculation in SessionExpirationUtils to use one or the other value. I prefer this way.

@mposolda @douglaspalmer Can you please test and review if you see something wrong?

Check client session is valid in TokenManager
Closes keycloak#24936

Signed-off-by: rmartinc <rmartinc@redhat.com>
This was referenced Apr 23, 2024
Copy link
Contributor

@douglaspalmer douglaspalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

Negative token expiration when changing client session max lifetime
2 participants