Skip to content

Token Generator

Generates JWT tokens for testing and development.

Building

bash
cmake .. -DENABLE_BUILD_TOKEN_GENERATOR=ON
make token_generator

Usage

bash
./token_generator --subject user123 --ttl 3600

Options

  • --subject — The token subject (user ID)
  • --ttl — Token lifetime in seconds
  • --grants — JSON grants object

--grants JSON format

json
{
  "channels": ["read", "write"],
  "admin": ["all"]
}

Example with all options:

bash
./token_generator \
  --subject user123 \
  --ttl 3600 \
  --grants '{"channels":["read","write"],"admin":["all"]}'

The generated token can be used to authenticate WebSocket and HTTP requests.