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
I would like to propose a new kwarg for Clients which would define a "buffer" for the token validity check.
This option would let the client consider a token expired x seconds earlier then it does.
With a default value of 0 the change should be backwards compatible
Additional context
The feature would apply to the OAuth2 Client.
The highest difference could also be capped at a percentage of the tokens lifetime to prevent the token being considered expired
when it is newly received.
Background
Today I ran into an error where an API I used responded with 401 Not Authorized despite using the auto refresh feature of oauthlib. After investigating I think the problem was that the access_token was considered valid (not expired) when the
request was sent by the client but was expired when it reached the server.
Therefore I'm proposing this feature.
The text was updated successfully, but these errors were encountered:
Describe the feature
I would like to propose a new kwarg for Clients which would define a "buffer" for the token validity check.
This option would let the client consider a token expired x seconds earlier then it does.
With a default value of 0 the change should be backwards compatible
Additional context
The feature would apply to the OAuth2 Client.
The highest difference could also be capped at a percentage of the tokens lifetime to prevent the token being considered expired
when it is newly received.
Background
Today I ran into an error where an API I used responded with 401 Not Authorized despite using the auto refresh feature of oauthlib. After investigating I think the problem was that the access_token was considered valid (not expired) when the
request was sent by the client but was expired when it reached the server.
Therefore I'm proposing this feature.
The text was updated successfully, but these errors were encountered: