This document describes authentication mechanisms for the HyperFleet API.
HyperFleet API supports two authentication modes:
- Development Mode (No Auth): For local development and testing
- Production Mode (JWT Auth): JWT-based authentication with configurable issuer
For local development and testing, authentication can be disabled.
# Start service without authentication
make run-no-auth
# Access API without tokens
curl http://localhost:8000/api/hyperfleet/v1/clusters | jqexport HYPERFLEET_SERVER_JWT_ENABLED=false
./bin/hyperfleet-api serveImportant: Never disable authentication in production environments.
Production deployments use JWT-based authentication with a configurable issuer.
# Start service with authentication
make run
# Access API with a valid JWT
curl -H "Authorization: Bearer ${TOKEN}" \
http://localhost:8000/api/hyperfleet/v1/clustersHyperFleet API validates JWT tokens using RS256 signature verification.
Token validation checks:
- Signature - Token signed by trusted issuer
- Issuer - Matches configured
HYPERFLEET_SERVER_JWT_ISSUER_URL - Audience - Matches configured
HYPERFLEET_SERVER_JWT_AUDIENCE - Expiration - Token not expired
- Claims - Required claims present
Token format:
Authorization: Bearer <jwt-token>
Example request:
curl -H "Authorization: Bearer ${TOKEN}" \
http://localhost:8000/api/hyperfleet/v1/clusters# Development (no auth)
export HYPERFLEET_SERVER_JWT_ENABLED=false
# Production (with auth)
export HYPERFLEET_SERVER_JWT_ENABLED=true
export HYPERFLEET_SERVER_JWT_ISSUER_URL=https://your-idp.example.com/auth/realms/your-realm
export HYPERFLEET_SERVER_JWT_AUDIENCE=https://your-api.example.comSee Deployment for complete configuration options.
Configure via Helm values:
# values.yaml
config:
server:
jwt:
enabled: true
issuer_url: https://your-idp.example.com/auth/realms/your-realm
audience: https://your-api.example.comDeploy:
helm install hyperfleet-api ./charts/ --values values.yaml401 Unauthorized
- Check token is valid and not expired
- Verify
HYPERFLEET_SERVER_JWT_ISSUER_URLandHYPERFLEET_SERVER_JWT_AUDIENCEmatch token claims - Ensure
Authorizationheader is correctly formatted
Token debugging
# Decode JWT token (header and payload only, not verified)
echo $TOKEN | cut -d. -f2 | base64 -d | jq
# Check token expiration
echo $TOKEN | cut -d. -f2 | base64 -d | jq '.exp | todate'- Deployment - Authentication configuration and Kubernetes setup