sttp-oauth2 icon indicating copy to clipboard operation
sttp-oauth2 copied to clipboard

Client credentials backend may use expired token, because of network latency

Open bwiercinski opened this issue 3 years ago • 0 comments

possible bug: if this check (isBefore) is evaluated just before token expires, then because of duration of request dispatching and network latency, when the request will come to the requested server it may be already expired.

i see 2 options:

  • retry whole process once when 401 will be responded
  • add threshold (let say default 10 seconds). then use (expiryInstant - threshold)

Originally posted by @bwiercinski in https://github.com/ocadotechnology/sttp-oauth2/pull/46#discussion_r590179098

bwiercinski avatar Mar 10 '21 08:03 bwiercinski