sttp-oauth2
sttp-oauth2 copied to clipboard
Client credentials backend may use expired token, because of network latency
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