Authentication
Login
Authenticate a user and return JWT tokens.
Validates the user’s credentials against the specified account and returns JWT tokens for authenticated access.
Flow:
- Resolve account by slug or ID
- Look up user by email in account
- Check authentication provider (OAuth/SAML users must use their respective flows)
- Verify password using timing-safe comparison
- Check if user is active
- Update last_login timestamp
- Generate JWT tokens
- Return response
Security:
- All authentication failures return the same generic 401 message
- Password verification is always performed (even with dummy hash) to prevent timing attacks
POST
Login
Body
application/json
Response
Successful Response
Response for successful authentication (login).
Previous
Refresh TokensRefresh access and refresh tokens.
Validates the provided refresh token, issues new tokens, and invalidates
the old refresh token (token rotation).
Flow:
1. Validate refresh token (signature, expiration, type)
2. Check if token is revoked in database
3. Get user information from token claims
4. Revoke old refresh token
5. Generate new access token and refresh token
6. Store new refresh token
7. Return new tokens
Next
Login