MFA for API Access
MFA for API access means requiring a second factor before issuing high-privilege tokens or before executing sensitive API operations. Humans authenticate with MFA at the identity provider; APIs enforce step-up scopes or fresh session proof at the gateway.
Technical Architecture & Deep-Dive
Not every API call needs MFA, but admin mutations, billing changes, and key rotation should demand recent MFA proof embedded in token claims or session metadata. Machine clients use mTLS or client credentials instead of TOTP.
Edge policies can reject tokens without an `amr` or `acr` value matching your policy, or call the IdP step-up endpoint to exchange a limited token for an elevated one. Log MFA events for audit and anomaly detection.
Key Architectural Benefits
Implement MFA for API Access at the Edge
Deploy lightweight API aggregation, edge caching, and secret injection in minutes without Docker containers or complex servers.
Frequently Asked Questions
Q:Should service accounts use MFA?
Service accounts should use cryptographic credentials such as mTLS or signed JWTs with rotation, not human MFA flows.
Related Architecture Concepts
WebAuthn is a W3C standard for passwordless authentication using public-key cryptography bound to a domain. Passkeys are synchronized WebAuthn credentials stored by platform providers, letting users sign in with biometrics or device PIN instead of passwords.
OAuth 2.0 is an authorization framework that lets an application obtain limited access to a user account on another service without handling the user password. The user approves requested scopes, and the application receives an access token it uses to call the service API.
OAuth scopes are named permission strings that define what an access token is allowed to do, such as read contacts or write payments. During authorization, the user or admin approves requested scopes, and the issued token carries only those grants.
The principle of least privilege states that every user, service, and credential should have only the minimum permissions required to perform its task. For APIs, this means using restricted keys, narrow OAuth scopes, and client tokens limited to specific endpoints.
Ready-to-Use Edge Recipes
Never place CLERK_SECRET_KEY inside Frontend / Web source. RealComposer injects them when calling https://api.clerk.com/v1/users/{{query.userId}}, so browsers see only a client token.
Never place API_BEARER_TOKEN inside Frontend / Web source. RealComposer injects them when calling https://{{secrets.API_HOST}}/status, so browsers see only a client token.
The Supabase service_role key bypasses all Row Level Security (RLS) rules. If leaked, an attacker has unrestricted admin access to your database. RealComposer keeps your service role key in the Secret Vault and exposes locked-down endpoints with strict output filtering.