Skip to main content

Supabase Auth Integration

Switchbord uses Supabase Auth as its authentication backbone. All user sessions are managed through Supabase’s JWT-based session system, with server-side validation on every API request.
Authentication is enforced at the API route level. Every route begins with session validation before any business logic executes.

Session Management

Session Timeboxing

Sessions are subject to two independent expiry controls: These limits are configured in Supabase and enforced server-side — extending them requires an admin configuration change, not a client workaround.

Session Revocation on Member Removal

When a workspace member is removed, their active sessions are immediately invalidated across all devices:
The 'global' scope ensures that all sessions for the user are terminated — not just the current one. This prevents a removed member from continuing to use an existing session after losing workspace access.

Password Policy

Switchbord enforces the following password requirements, configured in Supabase:
  • Minimum 12 characters
  • At least one uppercase letter
  • At least one digit
  • Enforced at signup and password change
Users are encouraged to use a password manager and generate unique passwords for each service.

Multi-Factor Authentication

Supabase TOTP (Time-based One-Time Password) MFA is available for all users. Users can enroll an authenticator app from their account settings.
MFA enforcement (requiring MFA for all workspace members) is currently planned and tracked in the roadmap. Until enforcement is implemented, MFA is opt-in per user. Organizations with strict compliance requirements should instruct their members to enroll.

Role-Based Access Control

Switchbord implements four roles with distinct permission levels. Role assignment is managed by workspace owners and admins.

Role Hierarchy

Role Enforcement

Role checks are performed at every API route after workspace context is resolved:
The role list passed to requireSettingsAccess defines the minimum required roles. Routes not in the list will receive a 403 response.

Role Capabilities Reference

API Key Management

Key Lifecycle

API keys allow programmatic access to Switchbord’s API. Each key is:
  1. Generated with a cryptographically random value
  2. Hashed with SHA-256 before storage — the plaintext is shown once at creation
  3. Scoped to the creating workspace — cannot be used to access other workspaces
  4. Optionally expiringexpires_at is enforced at validation time

Timing-Safe Comparison

API key validation uses crypto.timingSafeEqual to prevent timing-based side-channel attacks:

Key Expiry Enforcement

Keys with an expires_at value are rejected at validation time, even if the hash matches:

Key Operations Scoped to Workspace

All key operations (list, delete, revoke) are filtered by the caller’s resolved workspace:

Compliance Mapping

For the full compliance control mapping, see the Compliance Matrix.