amazon-web-services - AWS Cognito - 如何使用 CloudFormation 创建允许使用电子邮件地址注册的池?

标签 amazon-web-services aws-cloudformation serverless-framework amazon-cognito

我正在尝试使用 CloudFormation 语法创建 UserPool,但我无法找到需要设置哪个属性才能使用电子邮件地址注册创建池。我该如何指定这一点?

enter image description here

正如您在屏幕截图中看到的,默认情况下,池是使用用户名创建的。

这是我当前的池配置;

MyPool:
  Type: "AWS::Cognito::UserPool"
  Properties:
    Schema:
      - Name: sub
        StringAttributeConstraints:
          MinLength: '1'
          MaxLength: '2048'
        DeveloperOnlyAttribute: false
        Required: true
        AttributeDataType: String
        Mutable: false
      - Name: name
        StringAttributeConstraints:
          MinLength: '0'
          MaxLength: '2048'
        DeveloperOnlyAttribute: false
        Required: false
        AttributeDataType: String
        Mutable: true
      - Name: updated_at
        NumberAttributeConstraints:
          MinValue: '0'
        DeveloperOnlyAttribute: false
        Required: false
        AttributeDataType: Number
        Mutable: true
    UserPoolName: ${self:provider.environment.PARTNER_POOL}
    EmailVerificationMessage: 'Please click the link below to verify your email address.
        {####} '
    EmailVerificationSubject: Your verification link
    SmsAuthenticationMessage: 'Your authentication code is {####}. '
    DeviceConfiguration:
      ChallengeRequiredOnNewDevice: false
      DeviceOnlyRememberedOnUserPrompt: false
    AdminCreateUserConfig:
      InviteMessageTemplate:
        EmailMessage: 'Your username is {username} and temporary password is {####}. '
        EmailSubject: Your temporary password
        SMSMessage: 'Your username is {username} and temporary password is {####}. '
      UnusedAccountValidityDays: 7
      AllowAdminCreateUserOnly: false
    EmailConfiguration: {}
    AutoVerifiedAttributes:
      - email
    Policies:
      PasswordPolicy:
        RequireLowercase: false
        RequireSymbols: false
        RequireNumbers: true
        MinimumLength: 8
        RequireUppercase: false
    AliasAttributes:
      - email

最佳答案

CloudFormation 尚不支持使用新的注册流程选项配置用户池的功能。用于指定仅电子邮件或电话号码选项的参数是 UsernameAttributes .

我们将将此作为 +1 添加到功能请求中,以通过 CloudFormation 支持此功能。

关于amazon-web-services - AWS Cognito - 如何使用 CloudFormation 创建允许使用电子邮件地址注册的池?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46619746/

相关文章:

c++ - 上传图像文件在 AWS S3 C++ SDK 上花费的时间太长

amazon-web-services - AWS 上的 SSL 应用程序负载均衡器,无需自定义域

amazon-web-services - 创建具有恒定超时的 cloudFormation waitCondition

amazon-web-services - 如何在将启动 EC2 添加到 ELB 之前等待 cfn-signal

amazon-web-services - 添加 VPC 配置后调用 lambda 超时

node.js - serverless webpack 配置,手动添加目录

amazon-web-services - 为什么 CloudFormation 不创建我的数据库?

linux - 发出 AWS S3 路由规则和 SSL

amazon-web-services - Amazon ECS - 在 Docker 入口点上使用 IAM 角色时权限被拒绝

deployment - 无服务器 : Service files not changed. 跳过部署