amplify-ui: Bug (Authenticator): Missing support for SELECT_MFA_TYPE challenge

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

Create React App

What browsers are you seeing the problem on?

No response

Please describe your bug.

With Cognito User MFA configuration set to Choose preferred delivery method Authenticator Crashes

Ref: User Setting in Cognito image

Ref: Error on Chrome Console image

Ref: UI Screen when crash happens image

What’s the expected behaviour?

User should be presented with available MFA options and pick his/her choice

Help us reproduce the bug!

  • Install amplify
  • Create project using React-UI
  • Create User without providing phone
  • Configure TOTP MFA
  • Update user attributes to include phone, and verify it
  • Change MFA Configuration to Choose preferred delivery method on Cognito Console
  • Try authenticating user

Code Snippet

// Put your code below this line.

Additional information and screenshots

No response

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (10 by maintainers)

Most upvoted comments

@0618 I am talking about a case where user has provided both SMS, and has configured TOTP as can be seen in the screenshot (shared by me).

This can be achieved with following steps (as shared above)

  1. Create User without providing phone
  2. Configure TOTP MFA - You will be automatically prompted for it, once the UserPool is set to Require MFA
  3. Update user attributes to include phone, and verify it - I used AWS Cognito Console for this
  4. Change MFA Configuration to select Choose preferred delivery method using AWS Cognito Console

With above done, please try to login using amplify-ui based react app.

To add more details to the context, please see the flow below. You would notice that screen displayed on stage 2 never appears when using AmplifyUI.

image

Please do let me know, if you would need more information.

Just to update that we now have a plan to add support for choosing MFA delivery method but do not have an estimated delivery date at this time.

Hello @PritamDutt @github-julien-pie , Thanks for reporting this issue.

SELECT_MFA_TYPE is not supported by Amplify UI so far (@aws-amplify/ui@5.6.4, @aws-amplify/ui-react@4.6.4), so please make sure that there’s an MFA preference set in Cognito.

There’s no ETA at this moment.

For anyone following this issue, you can also keep an eye on issue #5829 as well since this bug should essentially be resolved once we get that feature implemented.

Just revisited this issue and figured out why I was not able to reproduce it. It was because I didn’t setup the TOTP MFA right after creating the account.

Also, I don’t have to modify MFA methods to Choose preferred delivery method to reproduce the issue.

So here’re the updated steps:

  1. Create User without providing phone (only, username, password and email)
  2. Configure TOTP MFA - You will be automatically prompted for it, once the UserPool is set to Require MFA
  3. Add a phone number to the user and mark it as verified
  4. Log in again to reproduce the issue

There’s a detailed note on this https://github.com/aws-amplify/amplify-js/issues/4646#issuecomment-1462908573

Hi @0618,

I can confirm this is still appearing with following versions of related libraries: “@aws-amplify/ui”: “^5.6.1”, “@aws-amplify/ui-react”: “^4.6.1”, “aws-amplify”: “^5.2.0”,

image

To double check ensure that ChallengeName is SELECT_MFA_TYPE in response to AWSCognitoIdentityProviderService.RespondToAuthChallenge on Cognito IDP

Let me know if you need more information.

Thanks for the detailed step. I just reproduced the error.

It might be a bug, but needs more investigation.