Open PritamDutt opened 1 year ago
Hi @PritamDutt If the user didn't provide a Phone number, the SMS MFA methods should be disabled as the following screenshot.
Could you provide more details on how to reproduce the error?
@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)
UserPool
is set to Require MFA
AWS Cognito Console
for thisChoose 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.
Please do let me know, if you would need more information.
Thanks for the detailed step. I just reproduced the error.
It might be a bug, but needs more investigation.
Hi @PritamDutt, This MFA configuration is not currently supported in the Authenticator UI, so we are marking this as a feature request.
However, it isn't expected to throw an error, so we are working on a bug fix to handle this scenario more gracefully in the meantime. This bug fix will not include the feature to choose a MFA method at this time.
Hi @reesscot,
This functionality is critical for a project I am working on, any tentative timelines that you can suggest. If timelines cannot be defined, would you be kind to guide me with suitable resources / steps that I can take to achieve this via some kind of hooks may be?
Thanks
Hey @PritamDutt !
I'm working on the bug fix to handle this scenario @reesscot mentioned above, but I'm no longer able to reproduce it at this moment.
Could you confirm that you still see the issue?
What I'm seeing is if I select Choose preferred delivery method
, the user is always asked for SMS message.
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",
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.
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:
There's a detailed note on this https://github.com/aws-amplify/amplify-js/issues/4646#issuecomment-1462908573
Hi there 👋 I can reproduce the same issue. Here is my config:
"@aws-amplify/ui-react": "^4.6.2",
"aws-amplify": "^5.2.2",
I would be more than happy if this feature was supported by the React component. Are you working on it? Any ETA? 😋
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.
Hi all,
Worked for me
if (user?.challengeName === 'SELECT_MFA_TYPE') {
// You need to get the MFA method (SMS or TOTP) from user
let mfaType = "SMS_MFA" // let's say selected this MFA method
user.sendMFASelectionAnswer(mfaType, {
onFailure: (err) => {
console.error(err);
},
mfaRequired: (challengeName, parameters) => {
// Auth.confirmSignIn with SMS code
},
totpRequired: (challengeName, parameters) => {
// Auth.confirmSignIn with TOTP code
},
}); // this send SMS code to user.
}
"@aws-amplify/ui-react": "^5.1.1",
"aws-amplify": "^5.3.10",
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.
This issue can also be reproduced as follows:
AdminCreateUser
method without a mobile number.Behaviour is the same for React & Angular. However, the hosted UI allows you to select either SMS or TOTP setup.
Hi @thaddmt Is the issue mentioned above related to the same problem? Also, is there any way I can assist in speeding up the delivery process?
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 toChoose preferred delivery method
Authenticator CrashesWhat's the expected behaviour?
User should be presented with available MFA options and pick his/her choice
Help us reproduce the bug!
Choose preferred delivery method
on Cognito ConsoleCode Snippet
Additional information and screenshots
No response