Unexpected internal error


I integrated Okta SignIn Widget performing Authentication Code Flow.
Recently there is this “There was an unexpected internal error. Please try again.”.
Browser Console does also not help realy: main.js?20201209 1305:97974 controller: primary-auth, error: [object Object]
Interestingly I can see all relevant calls (authn of Okta, callback on my side and redirect after this) in network monitor. Turns out that actually user is sucessful authenticated on backend but due to this error in the widget UI does not recognize and does not perform the last redirect initiated by my callback. A hard reload via F5 will make UI recognize authenticated state.
Unfortunately both handlers (success, error) provided to renderEl() will not be called making it unhandleable on my side.


So the /authn request is succeeding, but nothing happens? What does your widget code look like; more specifically, what is inside your renderEl call?

There is nothing special I guess

const signIn = new OktaSignIn({
            baseUrl: baseUrl,
            el: '#login-widget-container',
            clientId: clientId,
            redirectUri: redirectUrl,
            authParams: {
                issuer: baseUrl + '/oauth2/default',
                pkce: false,
                responseType: 'code',
                responseMode: 'query',
                scopes: ['eShop']
            features: {
                rememberMe: true,
                smsRecovery: true
            helpLinks: {
                // TODO custom help links

Which version of the widget are you using? Do you see the same issue regardless of the version you test with?

Its interesting that your earlier screenshot shows the authn resulting in a redirect and then you being sent back to the /login route with an authorization code, or do these events not correlate with what you see in the network events?

I am using Widget version 5.0.0

You understood correct: behavior and network log do not correlate and that’s exactly my problem.
I investigated a little bit further by calling /authn endpoint by my own and noticed the even with 200 returned Ajax’s success handler is not called. I now have this in place catching the error and checking for 200

error: (data) => {
  // for some weird reason error handler will be called even in case of 200
  if (data.status === 200) {