Overview
Xloud Identity uses Fernet tokens by default — stateless, symmetric-key-encrypted tokens that do not require a database lookup on every validation request. This guide covers token format selection, Fernet key rotation procedures, and lifetime configuration. Proper token configuration balances security (short lifetimes) with operational convenience (longer windows for automation pipelines).Token Format Reference
| Token Type | Storage | Validation | Use Case |
|---|---|---|---|
| Fernet | None (stateless) | Decrypted locally using key repository | Default. Recommended for all deployments. |
| JWT | None (stateless) | Verified locally via public key | Alternative to Fernet with standard JWT tooling. |
Fernet Key Rotation
Fernet uses a key repository with three key roles:| Key Role | Position | Description |
|---|---|---|
| Primary | 1 | Used to sign all new tokens |
| Secondary | 2+ | Used to validate tokens signed by previous primary keys |
| Staged | 0 | Pre-positioned key that will become the next primary on rotation |
Configure rotation schedule
XDeploy manages Fernet key rotation automatically via a scheduled cron job.
Configure the rotation interval in your deployment globals:
Fernet key rotation schedule
Rotate keys manually
To trigger an immediate rotation outside the scheduled window:After rotation, XDeploy synchronizes the new key set to all Identity API nodes.
Rotate Fernet keys
Token Lifetime Configuration
Token lifetime is configured in XDeploy globals. Shorter lifetimes improve security but increase re-authentication overhead for users and automation pipelines.Token lifetime settings
| Parameter | Default | Recommended | Notes |
|---|---|---|---|
keystone_token_expiration | 3600 | 3600 (1 hour) | Reduce for high-security environments |
keystone_allow_expired_window | 172800 | 172800 (48 hours) | Allows token re-issuance without password re-entry |
For long-running automation jobs, use application credentials
rather than increasing token lifetime. Application credentials can be scoped, restricted,
and rotated independently of user accounts.
Verify Token Configuration
Issue a token and inspect its expiry
Next Steps
Security Hardening
Enforce MFA requirements and audit token usage patterns.
Architecture
Understand how Fernet keys flow through the distributed Identity service.
Admin Troubleshooting
Diagnose token validation failures caused by key synchronization issues.
Application Credentials
Create long-lived automation credentials as an alternative to extended token lifetimes.