Gateway Authentication
The Gateway supports multiple authentication methods to accommodate different client types and security requirements.Authentication Methods
| Method | Use Case | Header Format |
|---|---|---|
| API Key | Third-party integrations | Authorization: Bearer olive_live_xxx |
| JWT | Admin dashboard, internal UI | Authorization: Bearer eyJ... |
| Service Auth | Internal services (Agent-TS) | X-Service-Auth: HMAC timestamp:signature |
| POS HMAC | Merchant terminals | X-HMAC-Signature: signature |
API Key Authentication
For third-party integrations and external clients.Header Format
API Key Structure
| Prefix | Environment |
|---|---|
olive_live_ | Production |
olive_test_ | Staging/Testing |
Creating API Keys
Admin users can create API keys via the admin endpoint:API Key Scopes
| Scope | Description |
|---|---|
payments:read | Read transaction history |
payments:write | Create payments and transfers |
balance:read | Read account balances |
subscribers:read | Read subscriber information |
subscribers:write | Create and update subscribers |
cards:read | List cards |
cards:write | Link/block cards |
JWT Authentication
For admin users and internal dashboards.Obtaining a JWT
Using JWT
JWT Claims
Admin Roles
| Role | Permissions |
|---|---|
system_admin | Full access to all operations |
compliance_user | Compliance alerts and monitoring |
support_user | Read-only access, basic support ops |
finance_user | Transaction and reconciliation access |
Service Authentication
For internal service-to-service communication (e.g., Agent-TS to Gateway).Header Format
Signature Generation
Configuration
Inconfig.yaml:
POS HMAC Authentication
Per-merchant HMAC for POS terminal authentication.Headers Required
Signature Calculation
Client Implementation
Combined Authentication
Some endpoints accept multiple authentication methods usingAllowServiceOrUser middleware:
Webhook Authentication
VULT webhooks use HMAC signature verification:Configuration
Verification Headers
Security Best Practices
API Key Security
API Key Security
- Store keys securely (never in client-side code)
- Rotate keys periodically
- Use scopes to limit access
- Set expiration dates
JWT Security
JWT Security
- Use strong secrets (minimum 32 characters)
- Set appropriate expiration times
- Implement token refresh flows
- Validate all claims
HMAC Security
HMAC Security
- Include timestamp to prevent replay attacks
- Validate timestamp is within acceptable window (5 min)
- Use constant-time comparison
- Rotate secrets periodically
Troubleshooting
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
- Check user has required role
- Verify endpoint is accessible with current auth method
HMAC Signature Mismatch
HMAC Signature Mismatch
- Verify secret matches on both sides
- Check timestamp format (unix seconds)
- Ensure body hasn’t been modified
- Verify correct encoding (UTF-8)