A script to get the installation token from a GitHub App
Instructions to create a GitHub App
When a Github App is created, you generate a private key which is used to generate a JSON Web Token. With that you can, query the installation token endpoint to get a token that can be used for API calls. These tokens will expire after some time.
This script will take your private key, generate the JWT then output an installation token for use. The script is more or less a wrapper for the ruby script that generates the JWT and then queries the installation endpoint for you with it.
- ruby w/ openssl and jwt
- a GitHub App private key
This was my original version that wrapped was a shell script that wrapped the ruby script.
Make sure the scripts are executable and run:
./get-installation-token.sh
Follow the prompts, and enter the path to the private key and the installation id when asked.
- openssl
- jwt
- net/http
- uri
Just run ./get-installation-token.rb
Follow the prompts and enter the path to the private key and enter the installation id when asked.