config/jwt/README.md
This document describes how to run Temporal server locally with JWT authentication enabled for test and development purposes.
The setup uses:
file:// URIdevelopment-jwt.yaml with authorization enabledconfig/development-jwt.yaml - Server config with JWT auth enabledconfig/jwt/setup-keys.sh - Generates RSA key pair and JWKSconfig/jwt/generate-token.sh - Helper script to generate test JWTsGenerated files (created by setup-keys.sh in /tmp/temporal-jwt-test/):
/tmp/temporal-jwt-test/private-key.pem - RSA private key for signing test JWTs/tmp/temporal-jwt-test/.well-known/jwks.json - JWKS file with RSA public keymake start-jwt - Start Temporal with JWT auth (no --allow-no-auth flag)make start-jwt
Note: Unlike other start-* targets, this does NOT use the --allow-no-auth flag, so authentication is enforced.
# Default: [email protected] with system:admin
./config/jwt/generate-token.sh
# Custom subject with system:admin
./config/jwt/generate-token.sh [email protected]
# Custom subject with namespace permission
./config/jwt/generate-token.sh [email protected] default:admin
# Multiple permissions
./config/jwt/generate-token.sh [email protected] system:admin default:writer
TOKEN=$(./config/jwt/generate-token.sh [email protected] default:admin)
temporal --tls=false --api-key "$TOKEN" workflow list