aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.02k stars 548 forks source link

Resend MFA Code #3534

Open alyssa-nash opened 4 months ago

alyssa-nash commented 4 months ago

Which AWS Services is the feature request for? Cognito

Is your feature request related to a problem? Please describe. When the user logs in with their credentials, they are directed to a MFA validation page where they enter the code that they have received. There are edge cases where due to a poor network connection or due to a delay, the user wishes to get a fresh code to enter without having to re-signin. There appears to be solutions for this for sign up confirmation and forgot password but not MFA.

Describe the solution you'd like Something similar to CognitoUser.resendConfirmationCode() in where a new MFA is generated and sent to the user.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Calling signIn again has been suggested but we do not wish to persist credentials between screens and it is prone to Code Mismatch Exceptions.

Additional context Add any other context or screenshots about the feature request here.

tjleing commented 4 months ago

Hello @alyssa-nash, seems like this flow isn't supported by Cognito (see similar issue on JS) which is why we don't provide that API. That thread offers other solutions for:

  1. configuring custom lambdas, possibly connected to REST APIs, that can be called to regenerate a new token, or
  2. storing the username and password and retriggering a signin call to create another OTP (you have mentioned that this is a suboptimal solution for your use case).