Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/romeovs/jwt

A simple jwt debugging tool
https://github.com/romeovs/jwt

Last synced: 24 days ago
JSON representation

A simple jwt debugging tool

Awesome Lists containing this project

README

        

# jwt

A simple debugger for [jwt][jwt] tokens written in Go.

## Installation

```sh
go install github.com/romeovs/jwt@latest
```

## Usage

To decode a JWT, just pass it as an argument:
```sh
jwt decode "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
```

You can also pipe the token into `jwt`, like so:
```sh
echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" | jwt decode
```

or pass a file as the argument:
```sh
jwt decode ./file
```

## Example output

The output looks like this:
```sh
Type JWT
Algorithm HS256
Subject 1234567890

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

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

[jwt]: https://jwt.io