Skip to main content

Simple JWT reader utility

Project description

Cat JWT

PyPI version

Install

pip3 install cjwt

Usage

usage: cjwt [-h] [--secret [SECRET]] [file]

positional arguments:
  file

options:
  -h, --help         show this help message and exit
  --secret [SECRET]  JWT secret

Examples

Read header and claims

  • Read from stdin
$ echo 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJ0ZXN0IjoiYWJjZGVmIn0.tPJ7bVKyF_FMFQaRT6n7dvhEBnyiBRGhVlwacTsy0mI' | cjwt
alg: HS256
typ: JWT
sub: 1234567890
name: John Doe
iat: 1516239022
test: abcdef
  • Read from file
$ cjwt /tmp/jwt.txt
alg: HS256
typ: JWT
sub: 1234567890
name: John Doe
iat: 1516239022
test: abcdef
  • Read from .roadtools_auth
$ cat .roadtools_auth | cjwt
typ: JWT
nonce: <cut>
alg: <cut>
x5t: <cut>
kid: <cut>
aud: https://graph.microsoft.com/
<snip>

Verify secret

echo 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJ0ZXN0IjoiYWJjZGVmIn0.tPJ7bVKyF_FMFQaRT6n7dvhEBnyiBRGhVlwacTsy0mI' | cjwt --secret 'secret'
alg: HS256
typ: JWT
sub: 1234567890
name: John Doe
iat: 1516239022
test: abcdef
echo 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJ0ZXN0IjoiYWJjZGVmIn0.tPJ7bVKyF_FMFQaRT6n7dvhEBnyiBRGhVlwacTsy0mI' | cjwt --secret 'not-secret'
alg: HS256
typ: JWT
Signature verification failed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cjwt-0.2.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

cjwt-0.2.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file cjwt-0.2.0.tar.gz.

File metadata

  • Download URL: cjwt-0.2.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.13 Darwin/22.6.0

File hashes

Hashes for cjwt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c0780e9db0e34daa593e5dee9dfed530da242de7ace83a0b44d6ac66db2da2c6
MD5 e597a77a67a367123b4c8f31d16bbb39
BLAKE2b-256 a0c205d26e5cad2584b963fc1b592a607646cc6edbb0be192e6d9cbbf27434e5

See more details on using hashes here.

File details

Details for the file cjwt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cjwt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.13 Darwin/22.6.0

File hashes

Hashes for cjwt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1bbfee08507b0acf6333a5348d1e3510fbca283fb79b8684425ca2993c407e6
MD5 c21f0b332406bda77957bf7dafd661f7
BLAKE2b-256 80108895625e35970fae72d5c9189d0c4034672ad7a5b79b8e13dd5c63407cc1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page