Skip to content

Issue with Resetting MFA in AWS Cognito User Pool

0

Hello AWS Support Team,

I am experiencing an issue with resetting Multi-Factor Authentication (MFA) in my AWS Cognito User Pool. Below are the details of my setup and the problem I am encountering:

Current Users Pool setup:

  • AWS Cognito User Pool Settings:
    • Multi-factor Authentication:
      • MFA Enforcement: Optional MFA
      • MFA Methods: Authenticator apps
    • Threat Protection:
      • Adaptive Authentication Risk Response Actions:
        • Low Risk: Optional MFA, do not notify
        • Medium Risk: Optional MFA, do not notify
        • High Risk: Optional MFA, do not notify

Problem:

  1. A new user is created without setting up MFA.
  2. The user logs in successfully.
  3. The same user logs in again from a different device, triggering a Risk Decision: Account Takeover.
  4. Despite the low-risk decision, the user is still able to log in, which is expected behavior.
  5. After logging in, the user can add MFA using the following methods (as described in the documentation):
    • AssociateSoftwareToken
    • VerifySoftwareToken
    • SetUserMfaPreference
  6. Additionally, I can reset the user's MFA using AdminSetUserMFAPreferenceRequest with the following parameters:
SoftwareTokenMfaSettings = new SoftwareTokenMfaSettingsType
{
    Enabled = false,
    PreferredMfa = false
},
SMSMfaSettings = new SMSMfaSettingsType
{
    Enabled = false,
    PreferredMfa = false
},
EmailMfaSettings = new EmailMfaSettingsType
{
    Enabled = false,
    PreferredMfa = false
}
  1. However, after performing this reset, if the user attempts to log in again and a Risk Decision is made, the user is still prompted to enter an MFA code. This happens even though MFA should be reset, and the user should have access without MFA.

It appears that the MFA reset process is not functioning correctly. Could you please advise on the correct method to reset MFA for a user so that they are no longer prompted for MFA upon logging in?

asked 2 years ago679 views

1 Answer
-1

The issue you're experiencing with resetting MFA in your AWS Cognito User Pool is complex and involves several factors. Let's break down the problem and provide some guidance:

  1. MFA Reset Process: The method you're using to reset MFA using AdminSetUserMFAPreference is correct. This should disable all MFA settings for the user.

  2. Risk-Based Authentication: Your User Pool is configured with Adaptive Authentication, which is still triggering MFA prompts based on risk assessment, even after you've reset the MFA settings. This is because risk-based authentication operates independently of the user's MFA settings.

  3. Persistent MFA Prompt: The fact that the user is still prompted for MFA after a risk decision, even when MFA has been reset, suggests that there might be a cached or persisted state related to the user's previous MFA setup.

To resolve this issue, you can try the following steps:

  1. Disable MFA completely for the user: Use the AdminDisableUserMFA API call to remove all MFA settings for the user.

  2. Clear user attributes related to MFA: Use AdminUpdateUserAttributes to remove any MFA-related attributes that might be persisting.

  3. Force password reset: Use AdminResetUserPassword to force a password reset for the user. This can help clear any cached authentication states.

  4. Review Adaptive Authentication settings: Consider adjusting your Adaptive Authentication settings if you don't want MFA prompts for low-risk scenarios.

  5. Re-enable MFA if needed: After successfully logging in without MFA, the user can set up MFA again using the AssociateSoftwareToken, VerifySoftwareToken, and SetUserMfaPreference methods.

If the issue persists after trying these steps, it may be worth contacting AWS Support directly, as there could be a specific configuration or edge case in your User Pool that's causing this behavior.

Remember, when working with MFA and security settings, it's crucial to balance security needs with user experience. Always test thoroughly in a non-production environment before applying changes to your live User Pool.

Sources
Cognito_MFA_Reset_or_reconfigure_for_user | AWS re:Post
AWS Cognito: Reset MFA device | AWS re:Post
Adding MFA to a user pool - Amazon Cognito

answered 2 years ago

    1. I searched for the AdminDisableUserMFA API call, but it doesn't appear to exist in the AWS Cognito API documentation.
    2. I have reviewed the user's attributes and there are no MFA-related attributes present.
    3. Forcing a password reset is not the desired behavior in this scenario.
    4. I have confirmed that the Adaptive Authentication settings are configured correctly
    5. I'm unclear on how re-enabling MFA after a reset would help resolve the issue where users are still being prompted for MFA despite the reset.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.