amazon-web-services - 在 AWS Cognito 中设置自定义属性
问题描述
我在 aws cognito 中使用 google 作为联合身份。
我已经创建了用户,但我无法添加自定义属性,我在用户池中有。我正在尝试使用控制台添加自定义属性。
User and Groups
当我点击-> Any of the user时,我没有看到这个自定义属性。
我还尝试使用 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
.
谢谢。
如果需要更多信息,请告诉我。
解决方案
这是您的联合池名称,而不是联合池 ID。
您可以通过以下方法获取联合池 ID:
从控制台选择您的身份池,在上面页面的顶部Pool ARN
将是Pool Id
. 它将以创建池的区域为前缀。
或者运行list-identity-pools,然后从Id
属性中复制值。
推荐阅读
- virtual-machine - 如何通过我的自定义网站的一键式按钮在 ESXi 服务器上自动部署虚拟机,该按钮托管在 ESXi 服务器上的一个虚拟机上?
- c# - 先按null排序,再按降序排列
- jms - 如何使用 JMS Correlation ID 识别消息?
- c++ - 如何使用backward-cpp在ARM上获取堆栈跟踪
- excel - 如何在Excel中编写百分比浮动值的IF语句
- solarwinds-orion - 查询以获取前 15 个最消耗带宽的对话
- google-bigquery - Parquet `write_table` 在写入输出文件时将数据类型的键引入数据
- database-design - 软件设计:带有定制产品的购物车
- android - RoundedRectangleBorder 在颤动中不能与 ListTile 或 Card 一起使用
- azure - 防止 CosmosDB 文档中的数组换行符