What is JWT?
What is JWT?
JSON Web Tokens (JWT) is an open standard for securely transmitting information between parties as a JSON object.A JWT consists of three parts separated by dots:
Example of the JWT:
Part | Contents | Encoding |
---|---|---|
Header | Metadata about the key id, signing algorithm and etc. | base64-encoded JSON |
Payload | Claims (data) you want to transmit | base64-encoded JSON |
Signature | Signature of base64url(header) + "." + base64url(payload) using private key | binary → base64url |
Header | eyJraWQiOiJCdWp0RjQwZlUyNXBGdlNabEdrQyIsImFsZyI6IkVTMjU2In0 |
Payload | eyJpYXQiOjE3NDkyMTI4NDQsIm1lc3NhZ2UiOiJhcnRlbS13YXMtaGVyZSJ9 |
Signature | NtTsKix0Fj6gXA9sSInfW9PRqO82RlLHyvY_ZKRkpofBeUHU8gsDnHP7_OjUeoB4nYHhsps1RLWFjzkyaJCkwQ |
Bron JWT Structure
Field | Description |
---|---|
alg | Signing algorithm |
kid | Your API key identity ID from the Bron App |
Step-by-Step Implementation
1
Prepare Your Credentials
- Generate or upload your API Key in the Bron App and obtain your API Key ID
- Save your private key securely
- Use your API Key ID (
kid
) in the JWT header.
2
Create the Message String
Concatenate these values in order (no delimiters):Components:
Example:
iat | Current timestamp in seconds (same value used in JWT payload) |
HTTP_METHOD | HTTP method in uppercase (GET, POST, PUT, DELETE) |
REQUEST_PATH | Full request path including query parameters (e.g. /api/v1/users?limit=10 ) |
REQUEST_BODY | JSON string exactly as sent (or noting if none) |
3
Generate SHA256 Hash
Compute SHA256 over the message string. In Node.js:Store that hex string in the JWT payload under
"message"
.4
Sign the JWT
Create and sign the JWT using your private key
Examples
Request:JWT Header:
JWT PayloadSigned JWT:Authorization Header:
Time | 1749219350 |
Message | 1749219350GET/workspaces/bron |
SHA256 Hash | 25e783b978eb059ef4ece027198e974a1ef7f00608f5033e101a1b956b6c8acd |