Periodic tokens in Vault are renewable credentials that you can extend indefinitely—provided you renew them before their TTL (time to live) expires. They’re ideal for long-running services or applications that cannot tolerate token expiration or frequent re-authentication.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Why Use Periodic Tokens?
- Unlimited lifetime: No
explicit_max_ttllimit (set to0s). - Automatic renewal: Reset the TTL back to the full period on each successful renewal.
- Safe revocation: You can revoke them at any time without leaving orphaned credentials.
Periodic tokens require careful management. Failing to renew before TTL expiry will invalidate the token and disrupt any dependent service.
Required Permissions
You need one of the following to create a periodic token:| Authentication Method | Required Privileges |
|---|---|
| Root token | Implicit full access |
| Non-root token | sudo capability on auth/token/create (see below) |
How Periodic Tokens Work
- Initial TTL
On creation, the token receives atoken_duration(e.g.,24h). - Renewal Period
Theperiodfield determines how far into the future you can renew (e.g.,24h). - Infinite Renewal
Withexplicit_max_ttl = 0s, you can renew the token indefinitely—until you choose to revoke it.
| Field | Description |
|---|---|
token_duration | Initial TTL before first renewal |
explicit_max_ttl | 0s indicates no maximum TTL |
period | Allows renewal up to this period after each renewal |
renewable | Must be true to renew |
Creating a Periodic Token
Use the Vault CLI to generate a periodic token. In this example, we assign thetraining policy and set a 24-hour renewal period:
token_duration: Initial TTLtoken_renewable:trueperiod: Renewal window
Inspecting a Periodic Token
To view the properties of your token:| Field | Description |
|---|---|
explicit_max_ttl | 0s (unlimited max TTL) |
period | Renewal interval (e.g., 24h) |
renewable | true |
ttl | Remaining time before next renewal |
Renewing a Periodic Token
Callvault token renew before the ttl expires to reset the TTL back to the full period:
Automate renewal for long-lived services using a cron job or HashiCorp Consul Template to avoid manual intervention.