commands.sh

jwt

all

Work with JSON Web Tokens (JWTs). Encryption algorithms available are HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384.

More info →

Options (4)

-j, --jsonboolean

Decode a JWT as a JSON string

Example: jwt decode {{[-j|--json]}} {{jwt_string}}
-A, --algboolean

Encode a JSON string to a JWT

Example: jwt encode {{[-A|--alg]}} {{HS256}} {{[-S|--secret]}} {{1234567890}} '{{json_string}}'
-S, --secretboolean

Encode a JSON string to a JWT

Example: jwt encode {{[-A|--alg]}} {{HS256}} {{[-S|--secret]}} {{1234567890}} '{{json_string}}'
-P, --payloadboolean

Encode key pair payload to JWT

Example: jwt encode {{[-A|--alg]}} {{HS256}} {{[-S|--secret]}} {{1234567890}} {{[-P|--payload]}} {{key=value}}

Examples (4)

Decode a JWT

jwt decode jwt_string

Decode a JWT as a JSON string

jwt decode [-j|--json] jwt_string

Encode a JSON string to a JWT

jwt encode [-A|--alg] HS256 [-S|--secret] 1234567890 'json_string'

Encode key pair payload to JWT

jwt encode [-A|--alg] HS256 [-S|--secret] 1234567890 [-P|--payload] key=value
made by @shridhargupta | data from tldr-pages