Self hosted login widget and MFA not returning after call to showSignInToGetTokens

We are using v7 of the Okta Login Widget. The following code makes the ajax call to our Login controller when the user account doesn’t have MFA enabled. However, when MFA is enabled the code doesn’t return to where we do the ajax call. How do I either get the code to return so that the ajax call is made, or is there another option?

 function (error) {
            oktaSignIn.showSignInToGetTokens({
                el: '#okta-login-container'
            }).then(function (tokens) {
                oktaSignIn.authClient.tokenManager.setTokens(tokens);
                oktaSignIn.remove();

                var data = {
                    accessToken: tokens.accessToken.accessToken,
                    idToken: tokens.idToken.idToken
                };

                $.ajax({
                    type: "POST",
                    url: "/Login/SubmitLogin",
                    data: addAntiForgeryToken(data)
                })
                .done(function (response) {
                    window.location = response.RedirectUrl;
                })
                .fail(function (response) {
                    global.AjaxFailedRedirect(response);
                });

            }).catch(function (err) {
                console.error(err);
            });
        });type or paste code here

Hi @whitemtnelf,

Do you have App level MFA policies configured ? Are you using Okta Classic Engine or Okta Identity Engine ?

We’re using Identity Engine. For testing MFA I use the provided ‘Any Two Factors’ authentication policy and assign it to my app.

I was wrong and it is working correctly. Please delete this post.

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