Skip to content

Auth.getPreferredMFA returns SMS_MFA when userpool is set to have TOTP only #11260

Open
@helgabalashova

Description

@helgabalashova

Before opening, please confirm:

JavaScript Framework

Not applicable

Amplify APIs

Authentication

Amplify Categories

auth

Environment information

N/A

Describe the bug

Userpool is set up to have required MFA with TOTP only. User confirms email at registration as well as provides unconfirmed phone number. User sets up Authenticator app at registration and successfully confirms sign in. User calls Auth.setPreferredMFA(SMS)(invoking setUserMFAPreference). Request results in SUCCESS. getUser call return SMS_MFA as preferred MFA method. User signs out and tries to log in again. User has SOFTWARE_TOKEN_MFA challenge at log in. AWS Cognito console has SMS_MFA as user’s MFA method.

Expected behavior

Auth.setPreferredMFA('SMS') call should result in error as userpool is configured to have TOTP only.

Reproduction steps

see description

Code Snippet

// Put your code below this line.

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

No one assigned

    Labels

    AuthRelated to Auth components/categoryCognitoRelated to cognito issuesMFAUsed when its related to issues with MFA / TOTP use casesService TeamIssues asked to the Service TeambugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions