After getting the error above, you need to find out if the user has an MFA factor enrolled or not. Call the MFA Authenticators endpoint, using the MFA token obtained in the previous section.
If the user is not enrolled in MFA, use the MFA token obtained earlier and enroll it using the MFA Associate endpoint. See the following links to implement this flow based on the authentication factor:
If the user is already enrolled in MFA, you need to challenge the user with one of the existing factors. Use the authenticator_id return by the MFA Authenticators endpoint when calling the MFA Challenge endpoint.After the challenge is complete, call /oauth/token endpoint again to finalize the authentication flow and get the authentication tokens.See the links below to implement this flow depending on the authentication factor:
Expiry time: The expiry time of MFA OTP codes is 5 minutes. This value is not configurable.Code validation: After a user validates an MFA OTP code, it cannot be used again.Code validation rate limiting: Unsuccessful user validation attempts are rate limited using a bucket algorithm. The bucket starts with 10 attempts and refreshes at a rate of 1 attempt per 6 minutes.