Skip to content

Get the GitHub App installation token with the GitHub App private key

License

Notifications You must be signed in to change notification settings

wilsonwong1990/get-installation-token-GH-APP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get-installation-token-GH-APP

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.

Requirements for bash version:

  • ruby w/ openssl and jwt
  • a GitHub App private key

How to use:

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.

Requirements for ruby version:

  • 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.

About

Get the GitHub App installation token with the GitHub App private key

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published