okta-auth-js
okta-auth-js copied to clipboard
authStateManager subscription callback not triggered on clear user session
Describe the bug?
Subscribing to the authStateManager, according to documentation:
const oktaAuth = new OktaAuth(config);
oktaAuth.authStateManager.subscribe(authState => {
console.log(authState.isAuthenticated);
});
i would expect to receive a callback immediately after user has been deactivated and or user session has been cleared. At the moment the callback is not triggered.
What is expected to happen?
I expect to receive an isAuthenticated=false message immediately after user session has been closed (by Session API or Admin Console).
What is the actual behavior?
Once user has been deactivated/session cleared, the authState will be updated only when the access token lifetime set in the authServer will expire:

Reproduction Steps?
- Login user
- Subscribe to authStateManager
- Deactivate user / clear use session
SDK Versions
"@okta/okta-angular": "^5.1.0",
"@okta/okta-auth-js": "6.4.5",
"@okta/okta-signin-widget": "6.3.3"
Execution Environment
Chrome
Additional Information?
No response
any news? im also having an issue after upgrade in this version,
// not triggering oktaAuth.authStateManager.subscribe(authState => {
}
"@okta/okta-auth-js": "7.8.1",
"@okta/okta-react": "6.9.0",
"@okta/okta-signin-widget": "7.24.2",
```