Skip to content

romeovs/jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
}

About

A simple jwt debugging tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published