Authentication
The Revelation 14 API uses JWT (JSON Web Tokens) for authentication. All API requests must include a valid access token in the Authorization header.Authentication Flow
Getting an Access Token
Login Endpoint
POST /auth/login
Authenticate a user and receive an access token
https://rzqklwfhwqmviintncqh.supabase.co/functions/v1/auth/login
Headers:
Content-Type: application/jsonapikey: your_supabase_anon_key
Using Access Tokens
Include the access token in theAuthorization header for all authenticated requests:
JWT Token Structure
The JWT token contains the following payload:id: Unique user identifierrole: User role (STANDARD_USER, ADMIN, etc.)iat: Issued at timestampexp: Expiration timestamp
Token Expiration
- Default Expiration: 2 hours
- Refresh: Tokens must be refreshed by re-authenticating
- Validation: Tokens are validated on each request
User Roles
Security Best Practices
Secure Storage
Store tokens securely on the client (encrypted storage, keychain)
HTTPS Only
Always use HTTPS for API communications
Token Validation
Validate token expiration before making requests
Logout Handling
Clear tokens on logout or app uninstall