Okta SSO callback is hanging | ReactJS

Hello Dev forum,
We’re trying to setup Okta SSO on our React application and we have a problem where instead of going to the route where the callback component from @okta/okta-react is, instead it just hangs on the callback route without redirecting anywhere, in the url I can see the ‘code’ and ‘state’ parameters -

image

also in the localStorage I can see that the ‘okta-cache-storage’ and ‘okta-shared-transaction-storage’ have values but the ‘okta-token-storage’ is empty -

I’ve searched all over the internet for an answer and got nothing, aswell as going over the code of the sample app, would appreciate any help!

HI,

I believe you should start checking with the route, specifically the route configured to LoginCallback component. This component is responsible for continuing the flow after the authorize call is successful. I guess the LoginCallback component is not being triggered.

Hey,
You are correct that the LoginCallback component is not getting triggered but it is not a routing issue, I tried replacing the LoginCallback component with a different component and it also didn’t show up but as soon as I removed the URL parameters (code and state) it started showing up.

Can you try out our sample app GitHub - okta/samples-js-react: React Auth SDK sample to see if this works for you?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.