Authentication
Configure API gateway authentication with JWT, Auth0, and Supabase. Supports OAuth 2.0, OTP passwordless login, and token-based auth.
Supported Authentication Providers
Provider
Type
Use Case
Quick Start
1. Configuration Setup
{
"$schema": "./api-config.schema.json",
"title": "Supabase Integration",
"description": "Configuration for Supabase authentication",
"cors": {
"allow_origins": ["https://app.example.com"],
"allow_methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
"allow_headers": ["*"],
"expose_headers": ["*"],
"allow_credentials": true,
"max_age": 3600
},
"authorizer": {
"type": "supabase",
"jwt_secret": "$env.SUPABASE_JWT_SECRET",
"issuer": "https://YOUR_PROJECT_ID.supabase.co/auth/v1",
"audience": "authenticated"
},
"paths": [
{ "method": "GET", "path": "/health", "response": { "status": "ok" } },
{ "method": "POST", "path": "/api/v1/supabase/auth", "integration": { "type": "supabase_passwordless_auth" } },
{ "method": "POST", "path": "/api/v1/supabase/verify", "integration": { "type": "supabase_passwordless_verify" } },
{
"method": "GET",
"path": "/api/v1/protected",
"response": {
"status": "protected endpoint",
"message": "You are successfully authenticated!"
},
"auth": true
}
]
}2. Environment Variables and Secrets
3. Deploy
Authentication Flows
Supabase OTP Flow
Auth0 OAuth Flow
JWT Flow
Protecting Routes
Security Best Practices
Related Pages
Last updated