Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 4

Installation access tokens

Solved! Go to Solution.

I know you need to generate a JWT token for your Github App in order to get an access token for an installation. However, when you do get an installation access token from

https://api.github.com/app/installations/:installation_id/access_tokens

, is that token returned an OAuth2 access token or a JWT token?

3 Replies
Community Manager
Message 2 of 4

Re: Installation access tokens

Hi @lostinpatterns,

 

Thanks for being here! That is a great question, you'd need to download the key to your local machine. You'll use this key to sign a JSON Web Token (JWT) and encode it using the RS256algorithm. 

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 3
Message 3 of 4

Re: Installation access tokens

Keep getting this message

{"message":"'Issued at' claim ('iat') must be an Integer representing the time that the assertion was issued","documentation_url":"https://developer.github.com/v3"}

 

I created the time using typescript  new Date().getTime() the numbers are as follows:

 

{
"iat": 1553791599468,
"exp": 932274959680800,
"iss": xxxx
}

Solution
Copilot Lvl 3
Message 4 of 4

Re: Installation access tokens

Realized my mistake, here is the JS script 

 

let iat = Math.round(Date.now() / 1000)
let exp = iat + (9 * 60)
let s = iat + " : " + exp
alert (s)

Take these numbers and paste it in jwt.io