Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't send the MFA token when user has both of SMS MFA method and Software Token MFA method #13962

Closed
4 tasks done
KimThanh27920 opened this issue Oct 25, 2024 · 4 comments
Closed
4 tasks done
Assignees
Labels
Auth Related to Auth components/category question General question transferred This issue was transferred from another Amplify project V5

Comments

@KimThanh27920
Copy link

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?

React App

What browsers are you seeing the problem on?

Chrome, Microsoft Edge

Which region are you seeing the problem in?

No response

Please describe your bug.

When user has multiple MFA methods, I try to send MFA code with type SOFTWARE_TOKEN_MFA, it always return invalid code error

What's the expected behaviour?

I believe the function should execute successfully and return my token.

Help us reproduce the bug!

Set up both of SMS MFA and Software Token MFA for the user, login normally and enter correct Software Token Code. It return invalid code error

Code Snippet

cognitoUser.sendMFACode(
          verifyCode,
          {
            onSuccess: () => {
               updateChallengeScreen();
               clearLoginProcessCookies();
              setIsSubmitting(false);
            },
            onFailure: function (err) {
              handleSessionExpired(err.message);
              setIsSubmitting(false);
            },
          },
          MFA_TYPE.SOFTWARE_TOKEN_MFA
        );

Console log output

No response

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending a response from the Amplify team. labels Oct 25, 2024
@jacoblogan
Copy link
Contributor

@KimThanh27920 Thank you for bringing this issue to our attention. Transferring the issue to aws-amplify/amplify-js repo that handles the underlying functions used by the authenticator component where the error message originates.

@jacoblogan jacoblogan transferred this issue from aws-amplify/amplify-ui Oct 25, 2024
@cwomack cwomack self-assigned this Oct 26, 2024
@cwomack cwomack added Auth Related to Auth components/category transferred This issue was transferred from another Amplify project question General question labels Oct 26, 2024
@github-actions github-actions bot removed the pending-triage Issue is pending triage label Oct 26, 2024
@HuiSF
Copy link
Member

HuiSF commented Nov 21, 2024

Hi @KimThanh27920 Thanks for opening this issue. Could you post the packages and versions listed in the package.json of your project?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Nov 21, 2024
@cwomack cwomack added pending-community-response Issue is pending a response from the author or community. V5 labels Nov 21, 2024
@cwomack
Copy link
Member

cwomack commented Nov 26, 2024

@KimThanh27920, wanted to circle back and see if you could share what's in your package.json as well as any relevant frontend code that's part of the MFA/signin flows.

Can you see if calling the confirmSignIn() API (in Amplify v5) rather than the sendMFACode() (as seen here) resolves the issue? Please ensure that you are calling Auth.signIn() followed by Auth.confirmSignIn() as well.

@cwomack
Copy link
Member

cwomack commented Dec 11, 2024

Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue.

Thank you!

@cwomack cwomack closed this as completed Dec 11, 2024
@github-actions github-actions bot removed the pending-community-response Issue is pending a response from the author or community. label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auth Related to Auth components/category question General question transferred This issue was transferred from another Amplify project V5
Projects
None yet
Development

No branches or pull requests

4 participants