You can configure offline session persistence with Keycloak so that you remain logged in without your session being interrupted by the token expiring.
When Keycloak is used as an identity provider, it can provide an offline access token. This token is a type of refresh token that does not expire, which ensures you are not logged out. This configuration is provided by the idp.OfflineAccess property. Set the property to false (the default value) to ensure the system provides a regular refresh token. Set the property to true to ensure the system provides an offline refresh token that does not expire.