Error During User Import: "MFA import error: String does not match pattern ^[A-Z2-7]+$: MFA_CODE_SUPPLIED"

Problem statement

While most users have been able to import successfully, a few users are getting this error when attempting to import:

MFA import error: String does not match pattern ^[A-Z2-7]+$: MFA_CODE_SUPPLIED

What is the reason for this error and how can it be resolved for these users?

Cause

This regex ^[A-Z2-7]+$ doesn’t have a-z in the range, only A-Z (capitalized). For MFA secrets being migrated that are in all lower-case this will cause the error message to be thrown.

Solution

Before importing these users, capitalize the MFA secret to pass this regex validation.

previous example secret:

mvteux2pywxx42w9

expected format for secret during import:

MVTEUX2PYWXX42W9