Even after successful login isAuthenticated() is returning false which is causing problem while I’m checking condition for logout. Is there anyway to cure this issue of isAuthenticated
I also checked the similar issues on the forum but haven’t found any solution yet.
Can anyone help me to solve it
I already tried solutions listed below which were not helpful
- adding the url in trusted origin in dashboard
- updated the verison
- tried the closeSession function
Did you confirm the user was issued tokens by Okta and that your application has stored them correctly in token storage? PS, which SDK are you referring to?
Im using the token issued by okta only also storing the tokens in token manager of the okta client
and using okta-auth-js/7.0.0 this version for sdk
Issue got resolved by using this “oktaClient.authStateManager._authState.accessToken”. The value of “oktaClient.authStateManager._authState.accessToken” gets changed when we login and also gets null when we log out. This thing I used to decide the condition to logout. But still isAuthenticated() is not changing value I don’t know why
Have you tried calling updateAuthState?
but i tried the getIdToken() and just resolved the issue and didn’t try anymore on the isAuthenticated() call its working fine now
Also exploring things related to idps
Thank you so much for the response,I will look into the updateAuthState as well .