GitXplorerGitXplorer
r

jwt

public
4 stars
1 forks
0 issues

Commits

List of commits on branch main.
Verified
2c17b316f8825f5cbe383ccec913b2e39fa7c64c

Add go.mod

rromeovs committed 7 months ago
Verified
0a04ff0489cf4e244a6268bd0f57e23c4788b90f

Update install instructions

rromeovs committed 7 months ago
Verified
5c0efbb837a508f9452c71d89055d77993b23f2e

Fix section headings

rromeovs committed 4 years ago
Verified
3aa0d828bc6ee65585b83f818c1573be82331378

Remove roadmap

rromeovs committed 4 years ago
Verified
959c8c97db729d52005a0036d9b84f972e378708

Fix --input doc string

rromeovs committed 4 years ago
Verified
df086ee628c882fb3acde015b3359c30e5498d1a

Add usage docs

rromeovs committed 4 years ago

README

The README file for this repository.

jwt

A simple debugger for jwt tokens written in Go.

Installation

go install github.com/romeovs/jwt@latest

Usage

To decode a JWT, just pass it as an argument:

jwt decode "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

You can also pipe the token into jwt, like so:

echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" | jwt decode

or pass a file as the argument:

jwt decode ./file

Example output

The output looks like this:

      Type  JWT
 Algorithm  HS256
   Subject  1234567890

    Issued  2018-01-18 02:30:22 +0100 CET
   Expires  <nil>
     Valid  token is valid

{
  "iat": 1516239022,
  "name": "John Doe",
  "sub": "1234567890"
}