Authentication & Authorization implementation checklist
This checklist provides a technical framework for validating authentication and authorization systems before moving to a production environment. It focuses on session security, data isolation in multi-tenant architectures, and the hardening of identity provider integrations.
Environment and Provider Configuration
0/5Credential Isolation
criticalVerify that production API keys, client secrets, and database URIs are stored in environment variables and are not present in the codebase or version control.
Redirect URI Allowlist
criticalEnsure that only production-specific callback URLs are configured in the auth provider dashboard (e.g., Clerk, Auth0, or Supabase) and that wildcards are disabled.
HTTPS Enforcement
criticalConfirm that all authentication endpoints and callback routes are served strictly over HTTPS and that the HSTS header is active.
Provider Webhook Signature Validation
criticalImplement signature verification for incoming webhooks from auth providers to prevent spoofed user-creation or deletion events.
Environment Parity Check
recommendedConfirm that the production environment uses a separate project/tenant in the auth provider dashboard from the staging or development environments.
Session and Token Security
0/5Cookie Flag Configuration
criticalSet session cookies with HttpOnly, Secure, and SameSite=Lax (or Strict) flags to mitigate XSS and CSRF risks.
JWT Claim Validation
criticalVerify that the backend validates 'exp' (expiration), 'iss' (issuer), and 'aud' (audience) claims for every incoming JWT.
Refresh Token Rotation
recommendedEnable refresh token rotation in the auth provider settings to invalidate old refresh tokens whenever a new access token is issued.
Short-lived Access Tokens
recommendedConfigure access token TTL (Time-To-Live) to 1 hour or less to minimize the window of opportunity for intercepted tokens.
Logout Invalidation
criticalEnsure the logout function clears the client-side cookie and triggers a server-side revocation of the session or refresh token.
Multi-tenancy and RBAC
0/5Tenant ID Filtering
criticalVerify that every database query for user data includes a 'tenant_id' filter derived from the authenticated session context, not from client-side parameters.
Middleware Role Checks
criticalImplement server-side middleware that checks user roles (e.g., 'admin', 'editor') before executing business logic or returning sensitive data.
Horizontal Escalation Test
criticalManually test that a valid user from Tenant A cannot access resources belonging to Tenant B by modifying resource IDs in API requests.
Role-Signed Tokens
recommendedInclude user roles or permissions within the signed JWT payload to avoid frequent database lookups for every permission check.
Default Deny Policy
recommendedConfigure the authorization layer to deny access by default if no explicit matching role or permission is found for the requested route.
OAuth and Social Identity
0/5State Parameter Validation
criticalConfirm the use of a unique, non-guessable 'state' parameter in OAuth requests to prevent Cross-Site Request Forgery during the callback flow.
Scope Minimization
recommendedAudit requested OAuth scopes (e.g., 'email', 'profile') and remove any that are not strictly required for application functionality.
Account Linking Logic
recommendedVerify that the system securely handles cases where a user signs in with different providers (e.g., Google and GitHub) using the same email address.
Callback Error Handling
recommendedImplement error boundaries for 'access_denied' or user-cancelled OAuth flows to prevent application crashes or infinite redirect loops.
Provider Branding Compliance
optionalEnsure social login buttons meet the brand guidelines of the providers (e.g., Apple, Google) to prevent rejection during app store reviews.
Endpoint Hardening
0/5Auth Rate Limiting
criticalApply strict rate limits to /login, /signup, and /forgot-password endpoints based on both IP address and user identifier.
Sensitive Data Masking
criticalAudit application logs to ensure passwords, tokens, and PII (Personally Identifiable Information) are masked or excluded from log outputs.
MFA Enforcement
recommendedRequire Multi-Factor Authentication for any user account with administrative or billing-related permissions.
Audit Logging
recommendedImplement a tamper-evident audit log that records login timestamps, IP addresses, and any changes to user permissions.
AI Quota Management
recommendedVerify that AI/LLM endpoints are protected by per-user rate limits and usage quotas to prevent billing exhaustion from compromised accounts.