认知用户池可以将SES与经过验证的域一起使用,而不与经过验证的电子邮件一起使用吗? [英] Can a cognito user pool use SES with a verified domain and not a verified email?

查看:70
本文介绍了认知用户池可以将SES与经过验证的域一起使用,而不与经过验证的电子邮件一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cognito的用户池采用的电子邮件配置需要经过验证的电子邮件的ARN.我可以使用经过验证的域上的任何电子邮件,而不是一封经过验证的电子邮件吗?

Cognito's User Pool takes an email config that needs an ARN of a verified email. Can I use any email on a verified domain instead of a single verified email?

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-email.html 我正在查看此文档,但是我不确定如何使用验证电子邮件"以外的其他方式来创建用户池,而已验证电子邮件"是无法自动执行的.我想要的替代方法是自动验证域,然后使用该域中的任何地址.

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-email.html I am looking at this documentation, but I am not sure how to make a User pool with anything other than a "verified email" which is not automatable. the alternative that i would like is to automate the verification of a domain and then use any address from that that domain.

推荐答案

我们能够通过CLI完成此任务.首先,转到SES中已验证的域,然后添加身份策略.

We were able to accomplish this via the CLI. First, go to your verified domain in SES and add an Identity Policy.

{
  "Version": "2012-10-17",
  "Statement": [
    {
        "Sid": "",
        "Effect": "Allow",
        "Action": [
            "SES:SendRawEmail",
            "SES:SendEmail"
        ],
        "Resource": "arn:aws:ses:us-east-1:YOUR_ACCOUNT_ID:identity/MYCUSTOM.DOMAIN.COM" <- arn of your SES domain
    }
  ]
}

然后在本地计算机上创建一个json文件.

Then create a json file on your local machine.

{
  "SourceArn": "arn:aws:ses:us-east-1:"accountid":identity/MYCUSTOM.DOMAIN.COM",
  "ReplyToEmailAddress": "no-reply@MYCUSTOM.DOMAIN.COM",
  "EmailSendingAccount": "DEVELOPER",
  "From": "no-reply@MYCUSTOM.DOMAIN.COM"
}

最后运行cli命令

aws cognito-idp update-user-pool --user-pool-id 'us-xxxx-X_XXXXXX' --region 'xx-xxxx-x' --email-configuration file://email.json

在用于您的认知池的AWS控制台中完成此操作后,您应该在发件人电子邮件地址" ARN下看到SES域的ARN,您可以在发件人地址"字段中指定所需的任何电子邮件.

When this is done in the AWS console for your cognito pool you should see the ARN of the SES domain under the From email address ARN and you can specify whatever email you want in the from address field.

注意:您这是生产中的现有池,您可能需要运行以下命令来获取电子邮件配置,以确保您不覆盖更新文档

Note: You this is an existing pool in prod you may want to run the following command to get the email config to make sure you don't override any settings as noted in the update documentation https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UpdateUserPool.html.

aws cognito-idp describe-user-pool --user-pool-id 'USER_POOL_ID' --region us-east-1

这篇关于认知用户池可以将SES与经过验证的域一起使用,而不与经过验证的电子邮件一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆