Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser timer throttling - expired refreshToken does not work to get the new accessToken #1411

Open
bkrajendra opened this issue May 17, 2024 · 2 comments

Comments

@bkrajendra
Copy link

bkrajendra commented May 17, 2024

As mentioned in this issue: #1345

Due to "Throttling of Javascript timers in background" feature of the browser, the timer slows down when the browser tab is inactive.

  • This stops the token Auto fresh interval when tab is inactive
  • If user return to inactive tab, due to expired refresh token, id token and accessToken, call to following will fail
    • call to tokenRfresh endpoint of OP will fail as refreshToken is expired
      • library does not handle handle or throw exception in this scenario
    • Logout call will fail as it also need IdToken to be valid

Probable valid flow:
Option 1: library should check for refresh token expiry before making the refresh call and initiate the login flow
Option 2: If refresh token call returns an invalid grant (401) response, library should initiate the login flow.

Reference: https://stackoverflow.com/q/64836377/846536

@davidsarkany
Copy link

Option 3: Use an interceptor that checks the access token validity before the request is sent.

@SandorDebnar
Copy link

@bkrajendra is there any progress with this issue ?
I have the same issue.. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants