Closed jpmckinney closed 1 month ago
Moto did recently add in 5.0.12 3 weeks ago https://github.com/getmoto/moto/blob/master/CHANGELOG.md#5012
CognitoIDP: initiate_auth() now supports USERNAME_PASSWORD_AUTH and SMS/Software Token MFA
So, we can probably mock a user with MFA a different way (e.g. opt-in the user via set_user_mfa_preference
or admin_set_user_mfa_preference
), instead of trying to test the full lifecycle of setting up MFA and then logging in.
On one hand, we'd be more confident if we could mock the full cycle. On the other hand, moto isn't AWS, so we need to trust that moto has the same behavior as AWS regardless.
Some errors had been logged to Sentry, so I had wanted to add tests to confirm behavior.
Moto doesn't presently support MFA setup.
See my open issues and draft PR: https://github.com/getmoto/moto/issues/created_by/jpmckinney
Here's a patch for a start to some tests once Moto is updated.