Authentication
Authentication overview
API reference for authentication and authorization
Overview
The Authentication API provides secure user authentication with support for:
- Username/password authentication
- Multi-factor authentication (2FA)
- JWT token management
- API key authentication
Authentication Flow
1. Initial Authentication
Response Options:
a) Direct Authentication Success:
b) When MFA is required:
2. Verify 2FA (if required)
Token Management
- Access Token: 15-minute lifespan, sent in Authorization header
- Refresh Token: 14-day lifespan, stored as HTTP-only cookie
- Token Format:
Authorization: Bearer <token>
Refresh Access Token
Security Features
- Brute force protection
- IP-based rate limiting
- Device tracking
- Secure token rotation
- HTTP-only cookies for refresh tokens
Required Headers
Header | Description | When to Use |
---|---|---|
Authorization | Bearer <token> | Required for all authenticated endpoints except login and self-registration |
X-Device-ID | Unique device identifier | Required for all authentication requests |
The Authorization header is not needed for /v1/authenticate
since this endpoint issues the token.