【发布时间】:2021-10-07 11:26:17
【问题描述】:
我正在尝试使用来自 json 文件的 AWS CLI 在 cognito 上创建用户池。正在创建池,但我无法设置它的某些属性。
注意:下面附加的一些快照取自AWS Docs for creating user pool。
-
我无法找到将电子邮件设置为验证属性的方法。
快照:
-
尽管我在我的 json 文件中指定了电子邮件消息和主题,但没有自定义它们。这让我想到了另一个问题(第 3 点)。
-
通过 CLI 创建用户池的 AWS 文档提到了三个属性。
- --email-verification-message(一个字符串)。
- --email-verification-subject(字符串)。
- --verification-message-template(A 结构)- 它具有设置消息和主题模板的属性。如果使用此结构(验证消息模板),前两个属性(电子邮件验证消息和主题)是否必要?由于该结构包含在内部设置消息和主题(请参阅下面的快照)。两者我都用过,但仍然无法设置消息并选择验证链接作为选项而不是验证码。
快照:
下面是我为创建池而形成的 JSON 对象
{
"PoolName": "xxx-userpool-local",
"Policies": {
"PasswordPolicy": {
"MinimumLength": 8,
"RequireUppercase": true,
"RequireLowercase": true,
"RequireNumbers": true,
"RequireSymbols": true,
"TemporaryPasswordValidityDays": 7
}
},
"UsernameAttributes": [
"email"
],
"EmailVerificationMessage": "Please click the link below to verify your account. {####}",
"EmailVerificationSubject": "Your account is ready",
"VerificationMessageTemplate": {
"EmailMessage": "Please click the link below to verify your account. {####}",
"EmailSubject": "Your account is ready",
"EmailMessageByLink": "Please click the link below to verify your account. {####}",
"EmailSubjectByLink": "Your account is ready",
"DefaultEmailOption": "CONFIRM_WITH_LINK"
},
"AdminCreateUserConfig": {
"AllowAdminCreateUserOnly": false
},
"UsernameConfiguration": {
"CaseSensitive": true
},
"AccountRecoverySetting": {
"RecoveryMechanisms": [
{
"Priority": 1,
"Name": "verified_email"
}
]
}
}
【问题讨论】:
标签: amazon-web-services amazon-cognito aws-cli