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
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.