Skip to content

Unable to Implement Email-Based MFA Authentication #13929

Closed as not planned
Closed as not planned
@arpita3112

Description

@arpita3112

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

Authentication

Amplify Version

v6

Amplify Categories

auth

Backend

None

Environment information

# Put output below this line


Describe the bug

We are trying to implement MFA (Multi-Factor Authentication) using email-based authentication. We have followed the steps and configured the SDK as per the official documentation:
https://docs.amplify.aws/javascript/start/connect-to-aws-resources/

However, we are still encountering the following error:
signInHelpers.ts:611 Uncaught (in promise) SignInException: An error occurred during the sign in process. EMAIL_OTP challengeName returned by the underlying service was not addressed. at getSignInResult (http://localhost:3000/static/js/bundle.js:85307:9) at signInWithSRP (http://localhost:3000/static/js/bundle.js:82737:85) at async loginBtnClick (http://localhost:3000/main.a99b129….hot-update.js:67:9)

We have reviewed the guide but could only find information related to SMS or TOTP-based MFA:
https://docs.amplify.aws/react/build-a-backend/auth/concepts/multi-factor-authentication/#enable-totp-after-a-user-is-signed-in

We also tried implementing the functionality using amplify/ui-react, but the error persists.

We are using the SDK version :
aws-amplify : v6.6.5

Is there a way to achieve email-based MFA with the above setup? Any guidance or solutions would be greatly appreciated.

Expected behavior

Complete the sign-in process without errors after the correct OTP is entered.

Reproduction steps

  1. First, install the SDK and configure it with Cognito.
  2. After that, call the signIn method from the SDK and pass the email and password.

Code Snippet

  Amplify.configure({
          Auth: {
            Cognito: {
              userPoolId: get(authcredetilas, "userPoolId", null),
              region: get(authcredetilas, "region", null),
              userPoolClientId: get(
                authcredetilas,
                "userPoolWebClientId",
                null
              ),
              identityPoolId: get(authcredetilas, "identityPoolId", null),
              loginWith: {
                email: true,
              },
            },
          },
        });

And

await signIn({
      username: "****",
      password: "****",
    })

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

AuthRelated to Auth components/categoryduplicateIf marked with duplicate, issue will be closed & original will be added for traceabilityfeature-requestRequest a new featurepending-maintainer-responseIssue is pending a response from the Amplify team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions