Skip to content
/ jwtutil Public

handy little jwt debugging utility to encode/decode tokens

Notifications You must be signed in to change notification settings

goware/jwtutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jwtutil

CLI tool for encoding/decoding JWT tokens.

Install

$ brew tap goware/tap
$ brew install jwtutil
$ jwtutil

or

$ docker run ghcr.io/goware/jwtutil

or

$ go install github.com/goware/jwtutil@latest

Usage

Create JWT token

$ jwtutil -secret=besafe -encode

Create JWT token with expiry (unix timestamp value)

$ jwtutil -secret=besafe -encode -exp=1585272657

Create JWT token with expiry in 5 days

$ jwtutil -secret=besafe -encode -exp $(date +%s --date='5 days')

Create JWT token with custom claims

$ jwtutil -secret=besafe -encode -claims='{"account":1234}'

Decode JWT

$ jwtutil -secret=besafe -decode -token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoxMjM0fQ.WrPyTSoovFETG6pW0wFepaAv9-VTIfeSHU5imhPqs7g'

LICENSE

MIT