Gateway Authentication
The Gateway supports multiple authentication methods to accommodate different client types and security requirements.Authentication Methods
API Key Authentication
For third-party integrations and external clients.Header Format
API Key Structure
Creating API Keys
Admin users can create API keys via the admin endpoint:API Key Scopes
JWT Authentication
For admin users and internal dashboards.Obtaining a JWT
Using JWT
JWT Claims
Admin Roles
Service Authentication
For internal service-to-service communication (e.g., Agent-TS to Gateway).Headers
Signature Generation
Configuration
Inconfig.yaml:
POS HMAC Authentication
Per-client HMAC for POS terminal authentication.Headers Required
Signature Calculation
Client Implementation
Partner HMAC Authentication
Partner routes use the same newline-delimited signature format as POS, with one additional header:Combined Authentication
Some endpoints accept multiple authentication methods usingAllowServiceOrUser middleware:
Webhook Authentication
VULT webhooks use HMAC signature verification:Configuration
Verification Header
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
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: RFC3339 for POS/Partner, unix seconds for service auth
- Ensure the exact raw body used for signing is what was sent
- Verify correct encoding (UTF-8)
Next Steps
Configuration
Full config.yaml reference
API Reference
Endpoint documentation