You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Expiration time' claim ('exp') must be a numeric value representing the future time at which the assertion expires
The issued at time is in the future
'Issued at' claim ('iat') must be an Integer representing the time that the assertion was issued
I would catch errors in auth.hook and look for the exp or iat in the error message. If either exists, log a warning, then read out error.headers.date to get GitHub's API time, store the difference to the current system time, and use that difference moving forward when calculating more JWTs.
If anyone would like to give this a shot, PRs welcome. I think it's a fun thing to work on. I'll need to implement this myself eventually, but it's not time critical yet
The text was updated successfully, but these errors were encountered:
gr2m
changed the title
Log system time and GitHub time in case of an "'Expiration time' claim ('exp') must be a numeric value representing the future time at which the assertion expires" error
Handle JWT errors due to out-of-sync system time
Aug 11, 2020
There are two errors we have to handle
The calculated expiration time is in the past
The issued at time is in the future
I would catch errors in
auth.hook
and look for theexp
oriat
in the error message. If either exists, log a warning, then read outerror.headers.date
to get GitHub's API time, store the difference to the current system time, and use that difference moving forward when calculating more JWTs.It can be implemented in a similar way as
@octokit/auth-basics
built-in request error handling:https://github.com/octokit/auth-basic.js/blob/68dd4638631c57994be455ee7cfca7c8f0c2de8c/src/request-with-2fa.ts
If anyone would like to give this a shot, PRs welcome. I think it's a fun thing to work on. I'll need to implement this myself eventually, but it's not time critical yet
The text was updated successfully, but these errors were encountered: