polyvariant / polyvariant/sttp-oauth2
Client credentials backend may use expired token, because of network latency
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 80
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the client-credentials token expiry check and the request path described in the issue. Compare the two proposed remedies—retrying after a 401 or applying an expiry threshold—and confirm the chosen behavior with tests covering network latency and expired tokens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100