A command line tool to get information about JWT tokens
jwtinfo
is a command line interface that allows you to inspect a given JWT token. The tool currently allows to see the body of the token in JSON format. It accepts a single command line argument which should be a valid JWT token.
Here's an example:
bash
jwtinfo eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Which will print:
json
{"sub":"1234567890","name":"John Doe","iat":1516239022}
You can combine the tool with other command line utilities, for instance jq
:
bash
jwtinfo eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c | jq .
You can install the binary in several ways:
You can install the binary in your system with cargo
:
bash
cargo install jwtinfo
At this point jwtinfo
will be available as a binary in your system.
Pre-compiled binaries for x64 (Windows, MacOs and Unix) and ARMv7 are available in the Releases page.
If you don't want to install a binary for debugging JWT tokens, a super simple bash
alternative called jwtinfo.sh
is available.
A special thank you goes to the Rust Reddit community for providing a lot of useful suggestions on how to improve this project. A special thanks goes to: mardiros, matthieum, steveklabnik1, ESBDB, Dushistov, Doddzilla7. Another huge thank you goes to the Rust stackoverflow community, especially to Denys Séguret.
Everyone is very welcome to contribute to this project. You can contribute just by submitting bugs or suggesting improvements by opening an issue on GitHub.
Licensed under MIT License. © Luciano Mammino & Stefano Abalsamo.