I am currently integrating Okta in a React SPA. I am using Okta’s react package. I have succeeded in implementing an authorization code flow in order to login the users. However I can’t seem to figure out how to refresh the tokens silently.
My current situation is that when a token expires (or reaches the expiration -
isAuthenticated is called, then
onAuthRequired is called and I get redirected to my login page. The following error messages displays in the console before
isAuthenticated is called:
error.errorCode: login_required, error.description: The client specified not to prompt, but the user is not logged in.
Is the error saying that I tried to refresh the tokens but it didn’t work? How can I fix this?