-
-
Save pelson/47c0c89a3522ed8da5cc305afc2562b0 to your computer and use it in GitHub Desktop.
Thank you, this helps a lot!
Thanks for this, I found it very helpful.
Two notes that I also found helpful:
- github's walkthrough of some of this: https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app
- since I'm working against a github enterprise install on a private domain, I had to replace
https://api.github.com/app
withhttps://<private domain>/api/v3/app
. Previously, I was just usinghttps://<private domain>/app
I was getting 406 responses; as soon as I adjusted the path, I started getting 200s.
Thank you so much!
Thank you this helps a lot.
Note that this functionality is offered by github3.py. See Issue with JWT token authentication in PyGithub for an example. The access token can be retrieved from the GitHub instance (GitHub.session.auth.token
).
Thanks for this!
Thanks for this!
Really appreciate this, it was super helpful!
Awesomely explained !!
In [53] code block
headers = {"Authorization": "Bearer {}".format(actual_jwt.decode()) ....
will be
headers = {"Authorization": "Bearer {}".format(actual_jwt) .....
@samit2040 its right
@pelson tks!!!
In [60] code block
resp = requests.post('https://api.github.com/installations/{}/access_tokens'.format(installation_id),
will be
resp = requests.post('https://api.github.com/app/installations/{}/access_tokens'.format(installation_id),
This was super helpful. Thank you so much!
Just in case is wondering, these are the dependencies needed. Do not install jwt
but pyjwt
. (see https://stackoverflow.com/questions/33198428/jwt-module-object-has-no-attribute-encode).
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
cryptography==38.0.3
idna==3.4
pycparser==2.21
PyJWT==2.6.0
requests==2.28.1
urllib3==1.26.12
Thank you very much!