HomeGuidesRecipesAPI EndpointsRelease NotesCommunity
Log In
Guides

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.

  1. SSH into your environment.
  2. Run sudo -i
  3. Run vim /data/layar/layar.config
  4. Press i to start editing.
  5. At the very bottom of the file add the desired configuration values IE. ACCESS_TOKEN_VALIDITY_SECONDS: 43200
    1. ❗️ You only need to configure the values you want to change.
  6. Press ESC to exit input mode.
  7. Run :wq to commit the changes.
  8. Run kubectl delete deployments --all
  9. Run kubectl delete statefulsets --all
  10. Run /data/layar/deployLayar.sh