dcycle / docker-gh-key-to-jwt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This project helps you generate a JWT from a private key and is meant for developers of GitHub apps.

Usage

Make sure you are the publisher of a GitHub App (not a GitHub oAuth App), and create a private key to access that app.

Visit Authenticating with GitHub Apps, which has more on the topic.

Once you have a private key, download it to your computer at /path/to/key.pem.

Clone this repo:

git clone https://github.com/dcycle/docker-gh-key-to-jwt.git
cd docker-gh-key-to-jwt

Generate a JWT which expires after 10 minutes. This takes three arguments, first the path to the directory contain your private key ("/path/to"); second, the filename of your private key ("key.pem"); and third, your GitHub app's ID:

# This uses the ruby script
./scripts/generate-jwt.sh /path/to key.pem 12345

TO use the Javascript script, you can use:

./scripts/generate-jwt-js.sh /path/to key.pem 12345

Resources

About


Languages

Language:Shell 55.6%Language:Ruby 21.8%Language:JavaScript 17.8%Language:Dockerfile 4.7%