I’m putting together an API for a project, and one of the requirements is MFA. I’m using TOTP and that all works. I also have facilities to clear the MFA token and regenerate / re-enroll the secret, but I’m wondering what the best practice is for invoking that.
Essentially I need a “forgot password” but for their MFA method (e.g. if they lose their phone or MFA secret).
Would a valid password + validation email be sufficient? Or should I require the user to contact the administrators to reset the MFA? Or something else?
Implementation Notes:
- MFA is required for a password reset, so if their email is compromised, the attacker wouldn’t necessarily be able to set a new password
- A valid email address is required and verified at signup.
- If they lose access to their email and MFA, they will have to contact the application administrators for assistance.
- This isn’t a “high stakes” application (e.g not banking, healthcare, etc) but I do want to make sure accounts are reasonably secure.


There’s a really nice high level overview of TOP/MFA by OWASP
They say:
The most important thing I think is, the MFA reset should have a different method and flow than the password reset option. Figure if an attacker attempts the ‘forgot password’ method, it’s assumed they have access to the users email. Therefore, you don’t want to send a ‘reset MFA’ in the same manner. The password recovery flow should be separate to the MFA recovery flow by using some form of out-of-band verification such as sending a password reset link within a “forgotten password email” containing a randomly generated and unique token that allows the user to reset the password only. The MFA recovery flow should work in a different manner. If you are offering TOTP only, I suggest offering a fallback method in place such as a list of “backup codes” of valid OTPs that the user needs to keep safe, and is obtained when first enrolling in MFA, or otherwise an OTP sent via SMS with a short expiration time. Ask for the TOTP while entering a new password. The reset link would be useless for the attacker.