Skip to main content

A simple command line jwt token generator based on a rsa private key.

By default it will print a JWT token with iss, nbf and exp set which is signed by the private key in ~/.ssh/id_rsa.:

iss - will be set to the current user name
nbf - will be set to 1 minute in the past
exp - will be set to 30 minutes in the future.

You can override the default settings on the command line.

Options

--issuer TEXT

of the token

--not-before INTEGER

number of seconds before now the token is no longer valid

--expires-after INTEGER

number of seconds after which the token is no longer valid

--private-key-file PATH

the private key file to sign the token with

-A, --authorization-header

print authorization header bearer token

--help

Show this message and exit.

Example

To send the the authorization bearer token with curl, type:

curl -H "$(jwt-generator -A)" https://httpbin.org/headers

Install on MacOS

To install you MacOs you might run into trouble due to the dependency on cryptography. Type::

export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

before you do the pip install jwt-generator. See https://github.com/pyca/cryptography/issues/2692 for details.

Metadata

Release files for jwt-generator 0.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jwt-generator 0.12.1
File Size Uploaded
jwt-generator-0.12.1.tar.gz 2.8 kB Details

Release files / jwt-generator-0.12.1.tar.gz

Download URL jwt-generator-0.12.1.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8eedf76ad3be7e3a3fe5be67666625000b02ea12cdd3ea7cc3927cdb0bda6c2b
BLAKE2b-256 checksum
How to use checksums
98c72d0bf0b3fbaa053b833c800dbb09ec3361828c3ca7f4a31136f03b946977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.12.1 This release

1 release file

0.12.0

1 release file

0.11.1

1 release file

0.11.0

1 release file

0.10.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

2 release files

0.3.2

1 release file

0.3.0

1 release file

0.1.9

1 release file

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page