Skip to main content

Overview

Zeus uses JWT (JSON Web Tokens) for stateless authentication. Tokens are issued after login and must be included in all API requests.

Authentication Flow

Login

Response:

Using Tokens

Include the token in the Authorization header:

Token Validation

Server validates tokens on each request:

Token Expiration

Tokens expire after 24 hours. Refresh by logging in again:
Response:

Error Responses

Invalid Credentials

Missing Token

Invalid Token

Implementation in Flutter

Security Best Practices

  1. Store tokens securely - Use platform secure storage
  2. Refresh before expiry - Don’t wait for 401
  3. Handle 401 gracefully - Redirect to login
  4. Use HTTPS - Never send tokens over HTTP
  5. Short expiration - Balance security vs UX