Skip to content

Cognito_MFA_Reset_or_reconfigure_for_user

0

My user pool has optional MFA enabled. How ever for a specific user MFA is enabled and able to login with mfa code but one time I have disabled the mfa for user also able to login without mfa. Now I have enabled mfa again but the user deleted qr in their authenticator app but for login it is asking for mfa Code. How can I reset or reconfigure the MFA

1 Answer
-1

Manual Reconfiguration :-

Disable MFA for the User:

You need to first disable the user's MFA to clear the existing MFA setup.

aws cognito-idp admin-disable-user-mfa \
  --user-pool-id <YourUserPoolId> \
  --username <Username>

Force a Password Reset (Optional):

You may want to force a password reset to ensure the user updates their security credentials.

aws cognito-idp admin-reset-user-password \
  --user-pool-id <YourUserPoolId> \
  --username <Username>
Re-enable MFA for the User:

Re-enable MFA for the user after ensuring the old MFA setup is cleared.

aws cognito-idp admin-set-user-mfa-preference \
  --user-pool-id <YourUserPoolId> \
  --username <Username> \
  --software-token-mfa-settings Enabled=true,PreferredMfa=true

User Logs In and Reconfigures MFA:

Instruct the user to log in. They should be prompted to set up MFA again with a new QR code.

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
  • I tried the solution recommended here, but the user is still not being prompted to setup MFA when it is optional for the user pool.

    Does anyone have any suggestions for how to utilize AWS Cognito with optional MFA? If I set MFA to required for the user pool, then users that do not have MFA configured are prompted to setup an MFA method, but there is no way for the user to setup MFA if MFA is optional for the user pool.

  • Hi Team,

    I was trying to replicate the steps, but "admin-disable-user-mfa" is not an option for cognito-idp. Has this workaround changed since you published it?

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.