This document outlines how to change the Keycloak default token lifetime or the token lifetime for a specific client.
Note: The default value for these settings is 365 days.
Log in to Keycloak with the default admin credentials.
Retrieve the admin
user’s password for Keycloak.
kubectl get secrets -n services keycloak-master-admin-auth -ojsonpath='{.data.password}' | base64 -d
Log in to the Keycloak UI using the admin
user and the password obtained in the previous step.
The Keycloak UI URL is typically similar to the following: https://auth.cmn.<system_name>/keycloak
Change Global Token Lifetime Values
Realm Settings
under Configure
on the left of the admin
page.Tokens
tab.Access Token Lifespan
Access Token Lifespan for Implicit Flow
Save
at the bottom of the page.Sessions
tab.SSO Session Idle
SSO Session Max
Save
at the bottom of the page.
Change A Specific Client’s Token Lifetime
Clients
under Manage
on the left of the admin
page.Advanced
tab.Advanced Settings
section.Access Token Lifespan
to the appropriate lifetime value.Save
at the bottom of the page.