CLICommands

jwt

snug jwt <COMMAND>

JWT token generation and management.

Subcommands

CommandWhat it does
keygenGenerate an RSA keypair for signing/verifying SnugNut tokens (RS256)
generateGenerate new JWT tokens
decodeDecode and inspect JWT without validation
verifyValidate JWT against secret and claims
refreshGenerate new token from existing (if valid)
configManage JWT configurations

Run snug jwt <command> --help for that command's own options. The global options apply everywhere.

Examples

snug jwt keygen --out-dir ./secrets
snug jwt generate user -u admin -t org123 --platform-role admin
snug jwt generate service -s worker -t org123 --scope '*:read'
snug jwt decode $SNUG_API_TOKEN
snug jwt verify $SNUG_API_TOKEN
snug jwt refresh $SNUG_API_TOKEN --extend 7d
snug jwt config show
snug jwt config set issuer https://auth.example.com

Next

On this page