How can I authenticate users who have enabled MFA on a custom Okta Login?

We have a support portal where we ask our agents to login with their Okta credentials. The login form is a custom login page built by us and not an Okta login widget. We’re Authenticating the User with the Okta Auth Library for React JS (by passing the credentials into the Library option).

The organization has now decided to enable MFA for all agents. So when agents log into the main okta account through the Org’s Okta website, they’re able to do it with MFA. But on our custom portal, when Agents login, the process does not succeed and gets stuck because the MFA is not available.

How can I solve this issue? Is there a way to integrate the Okta MFA on my custom login portal?

References:

  1. Okta Custom Login Page : Okta Auth JS and React | Okta Developer

Yup, you can definitely do this! Since you’re interacting with our endpoints directly, I imagine that would mean you are making requests to the /authn endpoint, passing in the username/password provided by the user.

For users that need to use a second factor, you will find that the response to this request will result in a status other than SUCCESS, most likely MFA_ENROLL or MFA_CHALLENGE. You will have to complete factor verification and/or enrollment based on this status.

I recommend reviewing our /authn API reference as well as this guide that walks you through the flow.