如何通过CloudFormation在Cognito中要求电子邮件验证?

Bir*_*sky 12 amazon-web-services aws-cloudformation amazon-cognito aws-cognito

我想我在这里试过所有的房产:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html

无法检查此框:

在此输入图像描述

我的配置目前:

    CognitoUserPoolGeneral:
      Type: AWS::Cognito::UserPool
      Properties:
        UserPoolName: general
        Policies:
          PasswordPolicy:
            MinimumLength: 6
            RequireLowercase: false
            RequireNumbers: false
            RequireSymbols: false
            RequireUppercase: false
        Schema:
          - AttributeDataType: String
            Name: preferredLocale
            DeveloperOnlyAttribute: false
            Mutable: true
            Required: false
        EmailVerificationMessage: "Here's your verification code: {####}. Please provide it inside the application."
        EmailVerificationSubject: "subject"
Run Code Online (Sandbox Code Playgroud)

Mik*_*ick 24

你可以加

  AutoVerifiedAttributes:
    - email
Run Code Online (Sandbox Code Playgroud)

对你的Properties钥匙,像这样:

  UserPool:
    Type: "AWS::Cognito::UserPool"
    Properties:
      UserPoolName: !Sub ${AuthName}-user-pool
      AutoVerifiedAttributes:
        - email
      Policies:.....
Run Code Online (Sandbox Code Playgroud)

有关创建Cognito资源的CloudFormation模板的绝佳示例,请参阅:

https://gist.github.com/singledigit/2c4d7232fa96d9e98a3de89cf6ebe7a5

  • @Birowsky我同意100%,'AutoVerifiedAttributes`是一个可怕的**名字. (16认同)
  • 等待.'AutoVerifiedAttributes'如何转换为'需要验证'? (9认同)
  • 它的意思是这样的:**自动开始电子邮件验证**当我查看它时,我认为这意味着:**电子邮件不需要验证,将其设置为自动验证**。 (5认同)