【问题标题】:How to allow only email as username alias with CloudFormation?CloudFormation 如何只允许电子邮件作为用户名别名?
【发布时间】:2018-05-26 10:17:47
【问题描述】:

this guide 之后,它说:

在“属性”选项卡上,选择电子邮件地址或电话号码,然后选择允许电子邮件地址。

看起来像这样:

但我在使用 CloudFormation 完成同样的事情时遇到了麻烦。尝试了几个obvious attributes,但没有奏效。想法?

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation amazon-cognito aws-cognito


    【解决方案1】:

    现在可以通过将UsernameAttributes 属性设置为包含emailphone_number 或两者的字符串数组来实现:

    Type: AWS::Cognito::UserPool
    Properties:
      UsernameAttributes:
      - "email"
      UserPoolName: "test-pool"
    

    【讨论】:

    • 这行得通,但我在文档中找不到这个;您是从哪里得知这件事的?
    • @DM 或者我想我在他们的论坛上找到了一个链接,该链接指向尚未在主站点上发布的文档的测试版。
    【解决方案2】:

    似乎不可能使用 CFN。看到这个线程: https://forums.aws.amazon.com/thread.jspa?threadID=259349&tstart=0

    用户名属性是最近推出的功能,它将是 即将添加到 cloudformation 模板中。

    【讨论】:

      【解决方案3】:

      完全同意0x6C38

      UserPool:
          Type: "AWS::Cognito::UserPool"
          Properties:
            UserPoolName: "test-pool"
            UsernameAttributes: [email]      
            AutoVerifiedAttributes:
              - email
      

      注意!用户池中只能设置 aliasAttributes 或 usernameAttributes 之一。

      【讨论】:

        猜你喜欢
        • 2013-10-27
        • 1970-01-01
        • 2021-09-19
        • 1970-01-01
        • 2015-04-27
        • 1970-01-01
        • 1970-01-01
        • 2015-06-30
        • 1970-01-01
        相关资源
        最近更新 更多