【发布时间】:2020-05-27 14:34:37
【问题描述】:
我在 aws cognito 中使用 google 作为联合身份。
我已经创建了用户,但我无法添加自定义属性,我在用户池中有。我正在尝试使用控制台添加自定义属性。
当我点击User and Groups 时,我没有看到这个自定义属性 -> 任何用户。
我也尝试使用 cognito 池作为 Idp(与 Google 一起),但这也没有改变任何东西。
我也试过用这个来创建用户:
aws cognito-idp admin-create-user \
--profile stage \
--region ap-south-1 \
--user-pool-id SSO-Test-User-Pool \
--username test@test.com \
--user-attributes Name=email,Value=test@test.com Name=custom:custom:role,Value="cms.tv_admin" \
--message-action SUPPRESS
但它给出了错误:
An error occurred (InvalidParameterException) when calling the AdminCreateUser operation: 1 validation error detected: Value 'SSO-Test-User-Pool' at 'userPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\w-]+_[0-9a-zA-Z]+
当我尝试使用此更新属性时也是如此:
aws cognito-idp admin-update-user-attributes \
--profile stage \
--region ap-south-1 \
--user-pool-id SSO-Test-User-Pool \
--username Google_113423776936123400493 \
--user-attributes Name=custom:custom:role,Value=admin
此外,我发现这些命令可以使用应用程序运行,并且他们需要在登录后返回代码,我想他们会使用重定向 URI 来获取代码。
如何在 CLI 中使用它?
我在App Client Settings 中的应用程序的自定义属性上设置了可读和可写属性。
谢谢。
如果需要更多信息,请告诉我。
【问题讨论】:
标签: amazon-web-services amazon-cognito