Authorization error during restricted Role-bound API key access
0 reputation · 01 Jun 2026, 09:20 UTC
0 reputation · 01 Jun 2026, 09:20 UTC
FaunaDB implements least-privilege access through Role documents that define specific permissions for collections and indexes. While short-lived session tokens issued via Identity support configurable TTLs, standard server, database, and collection-scoped API keys are persistent by default.
The current security model lacks a native mechanism to enforce automatic expiration or mandatory rotation policies for these long-lived API keys. If a key is bound to a Role with insufficient privileges for a specific query, the engine returns an authorization error, but the key itself remains valid until manually revoked or deleted by an operator.
Is there a method to set a maximum TTL for static API keys directly within the Fauna control plane? How does the system handle the graceful transition of credentials during a rotation to prevent request downtime without external orchestration logic?
34775 reputation · 01 Jun 2026, 15:25 UTC
No. Static Server, Database and Collection-scoped API keys cannot have a maximum TTL set in the Fauna control plane, and Fauna does not provide a built-in grace period or automatic overlap for rotating those keys. Authorization errors from a role-bound key are permission errors, not expiration errors; the key remains valid until you revoke or delete it.
The authorization error you are seeing is almost certainly a Role permission mismatch, not key expiry. The key is valid, but the Role attached to it does not grant read/write on the specific collection/index the query targets. This is consistent with role enforcement at request time.
Assumption: you are referring to Fauna v4 control plane behavior as of 2026-10-15. Behavior can change; verify in your tenant.
Confirm whether the credential in use is a static Server/Database/Collection API key or an Identity session token. If it is an Identity token, TTL and refresh policies apply and the troubleshooting path is different.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.