Authentication Token Timout Configuration
Introduction
The authentication tokens generated for API use stay alive for 28 hours by default. You can edit this using the Layar config file. Let's go over the three settings you can use to configure token life length.
ACCESS_TOKEN_VALIDITY_SECONDS
At the time the access token is created, this setting determines how long the initial token will be valid for. If this setting is not configured in layar.config it will default to 14400 seconds (4 hours).
REFRESH_TOKEN_VALIDITY_SECONDS
If a token expires and a request is made, a refresh token will be used. The refresh token is valid for the length that is set in this field. If this setting is not configured in layar.config it will default to 86400 seconds (24 hours).
INACTIVITY_TIMEOUT_SECONDS
If a token isn't used after a set period of time it will become invalid, this goes for both the initial token and the refresh token. If this setting is not configured in laya.config it will default to 1200 seconds (20 minutes).
Editing Layar.config
Restart Required
In order to deploy these settings the pods will need to be restarted, which will cause a short downtime for users.
Caution
When editing the file, make sure only to add what is needed. Deleting or adding irrelevant fields can disrupt Layars ability to operate.
- SSH into your environment.
- Run sudo -i
- Run vim /data/layar/layar.config
- Press i to start editing.
- At the very bottom of the file add the desired configuration values IE.
ACCESS_TOKEN_VALIDITY_SECONDS: 43200
- ❗️ You only need to configure the values you want to change.
- Press ESC to exit input mode.
- Run
:wq
to commit the changes. - Run
kubectl delete deployments --all
- Run
kubectl delete statefulsets --all
- Run
/data/layar/deployLayar.sh
Updated 18 days ago