Skip to main content
Issue a short-lived JWT for one subject and one action, then verify it in another handler or service.

Prerequisites

  • For mode: "transit": Vault enabled with a Transit key
  • For mode: "secret": a secret in config, GRANT_SECRET, or a Vault KV path

Steps

1. Choose a mode and enable grants

Transit (key stays in Vault):
Shared secret:
Or set GRANT_SECRET and omit secret. Or set secret_vault (and usually secret_field) with Vault enabled. Restart after enabling grants.

2. Issue a token

exp is seconds from now and cannot exceed max_exp.

3. Verify a token

allowed is { subject, action, context }. Wrong action, expired exp, or a non-object context is rejected.

Done

You can issue and verify grants without grant middleware. Config and algorithms: Grants.