Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/romeovs/jwt
- Owner: romeovs
- Created: 2016-09-28T15:54:01.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T15:39:10.000Z (5 months ago)
- Last Synced: 2024-10-13T05:06:57.117Z (about 1 month ago)
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 1234567890Issued 2018-01-18 02:30:22 +0100 CET
Expires
Valid token is valid{
"iat": 1516239022,
"name": "John Doe",
"sub": "1234567890"
}
```[jwt]: https://jwt.io