Hello everyone,
I’m currently implementing authentication using Keycloak, and I have a question regarding token refresh behavior.
When the access token is renewed, is there any way to automatically rotate (or refresh) the refresh token at the same time?
In our setup:
-
Access token lifetime: 1 hour
-
Refresh token lifetime: 5 days
-
Refresh token rotation: default behavior
The issue is:
Since the refresh token does not rotate automatically when the access token is refreshed, the user is forced back to the login screen as soon as the refresh token expires.
Because the access token is refreshed every hour, this means users are redirected to the login page right before the 120th renewal, when the refresh token hits its 5-day lifetime.
I’m looking for a way to keep the session alive (rotating the refresh token along with the access token), or any recommended configuration to avoid this forced login.
Any guidance or best practices would be greatly appreciated!
Thanks in advance.