Skip to main content

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

Response:

Using JWT

JWT Claims

Admin Roles

Service Authentication

For internal service-to-service communication (e.g., Agent-TS to Gateway).

Headers

Signature Generation

Configuration

In config.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:
The canonical string is:

Combined Authentication

Some endpoints accept multiple authentication methods using AllowServiceOrUser middleware:

Webhook Authentication

VULT webhooks use HMAC signature verification:

Configuration

Verification Header

Security Best Practices

  • Store keys securely (never in client-side code)
  • Rotate keys periodically
  • Use scopes to limit access
  • Set expiration dates
  • Use strong secrets (minimum 32 characters)
  • Set appropriate expiration times
  • Implement token refresh flows
  • Validate all claims
  • Include timestamp to prevent replay attacks
  • Validate timestamp is within acceptable window (5 min)
  • Use constant-time comparison
  • Rotate secrets periodically

Troubleshooting

  • Verify header format is correct
  • Check API key or JWT is valid and not expired
  • Ensure key has required scopes
  • Check user has required role
  • Verify endpoint is accessible with current auth method
  • 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