github3.exceptions.AuthenticationFailed: 401 'Expiration time' claim ('exp') must be a numeric value representing the future time at which the assertion expires
ashunikam4 opened this issue · 2 comments
Hello Team,
Firstly, Thanks for your effort on github3.py library. It works great for us.
Recently, we have come across an issue when authenticating app as an installation using github3.github.GitHub.login_as_app_installation. We get the following error:
github3.exceptions.AuthenticationFailed: 401 'Expiration time' claim ('exp') must be a numeric value representing the future time at which the assertion expires
It seems this is a popular issue when authenticating GitHub app using JWT tokens because of clock sync ( ref#1, ref#2), and the fix seems to be having a large expiry time (maximum 10 mins allowed ).
So, if you allow an argument like expire_in
for github3.github.GitHub.login_as_app_installation
, this should be resolved. Please let know if I am missing something, or there is a better solution than increasing the expiry time. Thanks.
If you'd like to send a pull request to add that as a optional keyword argument to
github3.py/src/github3/github.py
Lines 1430 to 1478 in 99a65b2
Sure. Thanks @sigmavirus24.