Giter Club home page Giter Club logo

jwt-generator's Introduction

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 pyca/cryptography#2692 for details.

jwt-generator's People

Contributors

mvanholsteijn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.