-
Notifications
You must be signed in to change notification settings - Fork 267
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
Added 'Simulate cross-tab token renew' in test app #1106
Conversation
…on between iframes to start renew.
c41d5de
to
f4e6eec
Compare
Noticed the side effect after #1087: there can be situations during cross-tab token renewal when renew fails in one tab with HTTP 429 but can be retried successfully. Explanation: In okta-auth-js/lib/TokenManager.ts Lines 425 to 427 in 4d8a7b9
Expired token is removed from storage and triggers EVENT_REMOVED .okta-auth-js/lib/TokenManager.ts Lines 379 to 384 in 4d8a7b9
AuthStateManager listens to this event and calls updateAuthState() here:okta-auth-js/lib/AuthStateManager.ts Lines 71 to 74 in 4d8a7b9
In updateAuthState() call to isAuthenticated() will be performed:okta-auth-js/lib/AuthStateManager.ts Line 158 in 4d8a7b9
In isAuthenticated() token can be renewed if autoRenew options is set:Lines 572 to 579 in 4d8a7b9
Note two things:
When During Proposals?
|
OKTA-456240 <<<Jenkins Check-In of Tested SHA: 7cea0c5 for eng_productivity_ci_bot_okta@okta.com>>> Artifact: okta-auth-js Files changed count: 5 PR Link: "#1106"
Internal ref: https://oktainc.atlassian.net/browse/OKTA-456240
Added button 'Simulate cross-tab token renew' in test app that opens 20 iframes that tries to autorenew tokens simultaneously.
Practically system allows to run 15 simultaneous renew requests, next ones will result in HTTP 429.
See video
cross-tab-test-app.mov