Repository navigation
Use SessionExpirationUtils for validate user and client sessions. Check client session is valid in TokenManager. - #29013
Conversation
There was a problem hiding this comment.
@rmartinc @douglaspalmer Thanks for the fix and review!
I've added some nitpick comments, which can be easily fixed (if you think they make sense) as the rebase in fixing conflict is needed anyway.
+1 for adding some migration documentation
|
@mposolda Moving from draft as we all agreed to change the calculation like in the other parts. Requested changes added and rebased because there was a conflict. Liitle note in the upgrade guide also added. |
Check client session is valid in TokenManager Closes keycloak#24936 Signed-off-by: rmartinc <rmartinc@redhat.com>
|
The new Persistent Session IT tests were failing. The reason seems to be that if the client session is removed and added in the same transaction the old session remains. I have changed to (instead of remove/add) do a restart similar to what we do in the user session. I'm adding @ahus1 to review because maybe I'm doing something wrong. 😄 |
|
@rmartinc - can you please point me to where you did this change? |
Yes, here. In the previous version of the PR there was a remove/create of the client session. Now I created a |
There was a problem hiding this comment.
Thank you for the PR, looks good to me.
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.isSessionValidto also useSessionExpirationUtilscalculations. I'm sending a draft because of the last change. This is modifying some tests because previously theisSessionValidused 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 (asSessionExpirationUtilsdoes). 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 inSessionExpirationUtilsto use one or the other value. I prefer this way.@mposolda @douglaspalmer Can you please test and review if you see something wrong?