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

(cognito): SMS configuration and verification is required when OTP is chosen #12075

Closed
heyarnold1 opened this issue Dec 14, 2020 · 2 comments
Closed
Assignees
Labels
@aws-cdk/aws-cognito Related to Amazon Cognito bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@heyarnold1
Copy link

heyarnold1 commented Dec 14, 2020

Cannot build a User Pool with MFA using OTP without phone number configuration and verification which is inconsistent with the console

Reproduction Steps

mfa_second_factor = aws_cognito.MfaSecondFactor(otp=True, sms=False)

cognito_user_pool = aws_cognito.UserPool(
            self,
            "my-cognito-pool",
            account_recovery=aws_cognito.AccountRecovery.EMAIL_ONLY,
            auto_verify=auto_verify,
            enable_sms_role=False,
            mfa=aws_cognito.Mfa.REQUIRED,
            mfa_second_factor=mfa_second_factor,
            self_sign_up_enabled=True,
            sign_in_aliases=sign_in_aliases,
            sign_in_case_sensitive=False,
        )

What did you expect to happen?

In the console I can create User Pool with the above configuration. I would expect the same behaviour on the CDK

What actually happened?

I got this error

SMS configuration and Auto verification for phone_number are required when MFA is required/optional (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; R

Environment

  • CDK CLI Version :1.78.0
  • Node.js Version:15.3.0
  • Language (Version): Python (3.8)

This is 🐛 Bug Report

@heyarnold1 heyarnold1 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 14, 2020
@github-actions github-actions bot added the @aws-cdk/aws-cognito Related to Amazon Cognito label Dec 14, 2020
@nija-at
Copy link
Contributor

nija-at commented Jan 7, 2021

Duplicate of #11478

@nija-at nija-at marked this as a duplicate of #11478 Jan 7, 2021
@nija-at nija-at closed this as completed Jan 7, 2021
@github-actions
Copy link

github-actions bot commented Jan 7, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cognito Related to Amazon Cognito bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants