Authentication
Dimebia uses JWT (JSON Web Tokens) for authentication. This guide covers the authentication flow, token management, and security best practices.
Authentication Methods
Dimebia supports two authentication methods:
- JWT Access Tokens: For user-facing applications (admin UI, merchant portal)
- API Keys (SK): For server-to-server integrations
JWT Authentication Flow
┌─────────┐ POST /api/user/login ┌─────────┐
│ Client │ ──────────────────────────────► │ API │
│ │ ◄────────────────────────────── │ │
└─────────┴ { accessToken, └─────────┘
refreshToken }
│
│ Authorization: Bearer <accessToken>
▼
┌─────────┐ API Request ┌─────────┐
│ Client │ ──────────────────────────────► │ API │
│ │ ◄────────────────────────────── │ │
└─────────┴ Response └─────────┘