manfredsteyer / angular-oauth2-oidc

Support for OAuth 2 and OpenId Connect (OIDC) in Angular.
MIT License
1.86k stars 681 forks source link

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

Open bkrajendra opened 1 month ago

bkrajendra commented 1 month ago

As mentioned in this issue: https://github.com/manfredsteyer/angular-oauth2-oidc/issues/1345

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

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