Service Token Authentication (Legacy)
The original authentication method using a shared secret via X-Service-Token header.
How It Works
- Configure
SERVICE_TOKENSenv var with comma-separated allowed tokens - Client sends
X-Service-Token: <token>header - Engine compares against the allowlist
- If match → proceeds. If not →
401 Unauthorized
Configuration
env
SERVICE_TOKENS=token1,token2,token3Usage
bash
curl http://localhost:8100/api/v1/wallets/balance?userId=1 \
-H "X-Service-Token: e33421bd5f0663d04000b1c0c289d3678d2eb4f66de353166f4f1bdcbac690c2"Scope
Service Token auth grants full access to all tenants and all operations. It does not set a tenant context — you must pass tenantSlug in request bodies or query params.
When to Use
- Internal service-to-service communication (app-core-backend → comet-engine)
- Admin endpoints (
/api/v1/admin/*) require service token auth - Legacy integrations that haven't migrated to API key/secret
Migration to API Key/Secret
For new integrations, prefer API Key/Secret auth:
- Per-tenant isolation
- Rotatable secrets
- No shared secrets across services