Okta widget does not work when deployed

The okta sign in widget does not work when deployed, but it works fine on localhost. After signing in and entering an OTP code it disables the “verify” button and just hangs there.

On localhost it makes a call to /token at this point, but when deployed it doesn’t do that. I have my urls in the Trusted Origins for CORS and my site is HTTPS.

For anyone else that runs into this issue, where the widget freezes with no errors and all the network calls pass, try putting the widget into debug mode by setting up the “afterError” event listener:

    widget = new OktaSignIn(oktaConfig);
    widget.on('afterError', (context, error) => {
      console.error('widget error', context, error);
    });

This allowed me to find the issue (in my case I hadn’t added a RedirectUri for my deployed server in my Okta Application settings). Hopefully this helps someone else from a day of frustrating trial and error debugging.

1 Like

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