Authentication
Production-ready identity in three lines. OAuth (15 providers), MFA TOTP, magic links, OTP email and SMS, RBAC — a single SDK, zero opaque redirection.
What aura-auth does
The aura-auth service issues and validates JWTs for users in a project. The signature is ES256 by default, with a project-derived secret; RS256 (and exposing a JWKS) is only used if an RSA key is configured — this is an opt-in, not the default behavior. It manages the complete lifecycle: registration, email verification, MFA, refresh token rotation, server-side revocation.
Each token embeds sub, project_id, role (anon or authenticated), email, and an app_metadata object that carries your server-side claims (tenant, roles). The gateway injects these claims into Postgres connections via request.jwt.claims, making RLS policies directly accessible to auth.uid(), auth.role(), auth.tenant().
User tables live in project_{uuid}_auth: users, oauth_accounts, refresh_tokens, mfa_factors, sessions, auth_audit_log.
Three actors, three responsibilities
The client signs a challenge, the service hits the base, the gateway validates on each subsequent request.
Eight mechanisms ready
Email + password
Argon2id, optional email verification, secure rotation.
OAuth 2.1 · PKCE
15 providers — Google, GitHub, Apple, Microsoft, Discord, Twitter, Facebook, Bitbucket, Figma, Notion, Spotify, Twitch, Zoom, Kakao, Snapchat.
MFA TOTP
Authy, 1Password, Google Authenticator. Fallback SMS.
Magic links & OTP
Email without password, i18n templates, rate-limit by address.
Granular RBAC
Roles, permissions, org hierarchies. Self-generated RLS policies.
Session binding
Device fingerprint, IP check, rotation refresh tokens.
Four streams, one SDK
In Next.js App Router, always use the createServerClient helper from @aurabase/aurabase-js/ssr in server actions and route handlers. The cookie refresh token is httpOnly and should never be read by client JS.
If you are not using the SDK
All flows are also exposed in raw REST, with the same server-side validations. See /docs/api-rest for the complete list.
MethodEndpointDescription
POST/v1/auth/registerCreate an email account + password
POST/v1/auth/loginAuthenticate with password
GET/v1/auth/oauth/{provider}/startStart OAuth flow (PKCE)
POST/v1/auth/magic-linkSend a magic link
POST/v1/auth/email-otp/sendSend an OTP code by email
POST/v1/auth/mfa/setupEnroll a TOTP factor
POST/v1/auth/refreshRefresh token pair
GET/v1/auth/meReturn current user
GET/v1/auth/sessionsList active sessions
DELETE/v1/auth/sessions/{session_id}Revoke a specific session
POST/v1/auth/logoutClose current session