amazon-cognito - 如何使用自定义映射 cloudform cognito 用户池身份验证提供程序
问题描述
我已经成功地 cloudformed 一个 cognito 身份池,但看不到如何将自定义映射添加到 cloudformation 中的“Cognito”“身份验证提供程序”。
在控制台上的 Cognito 身份验证提供程序内,有一个下拉列表,我必须手动选择“使用自定义映射”,然后我可以手动将映射添加到我的自定义用户属性。但是,我需要能够对此进行云化处理,并且正在努力为它找到正确的位置。
与此身份池一起使用的用户池将“SupportedIdentityProviders”设置为“COGNITO”
更新
我可以通过运行来获取身份提供者列表...
aws cognito-identity list-identities --max-results 2 --identity-pool-id xx-xxxx-x:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
这让我回来了
{
"IdentityPoolId": "xx-xxxx-x:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"Identities": [
{
"IdentityId": "yy-yyyy-y:yyyyyyyy-yyyy-yyyy-yyyyyyyyyy",
"Logins": [
"cognito-idp.eu-west-2.amazonaws.com/eu-west-2_tFT6FBwIO"
],
"CreationDate": "2021-11-15T12:38:48.249000+00:00",
"LastModifiedDate": "2021-11-15T12:38:48.263000+00:00"
}
]
}
使用“登录”信息我现在可以运行...
aws cognito-identity get-principal-tag-attribute-map --identity-pool-id xx-xxxx-x:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx --identity-provider-name "cognito-idp.eu-west-2.amazonaws.com/eu-west-2_tFT6FBwIO"
返回
{
"IdentityPoolId": "xx-xxxx-x:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"IdentityProviderName": "cognito-idp.eu-west-2.amazonaws.com/eu-west-2_tFT6FBwIO",
"UseDefaults": false,
"PrincipalTags": {
"attr_x": "custom:attr_x",
"attr_y": "custom:attr_y",
"attr_z": "custom:attr_z"
}
}
但是,我仍然不知道如何通过 cloudformation 设置此映射...
问候马克。
解决方案
CloudFormation 尚不支持设置 PrincipalTag 属性映射,但根据 CloudFormation 路线图,很快就会支持。同时,您必须创建CloudFormation 自定义资源或资源提供者来实现此目的。
推荐阅读
- sql-server - XAMARIN - 是否可以使用 SQL 查询验证进行登录?
- google-apps-script - 自动将数据从 Google 表格复制到 Google 文档模板
- python - 如何使用 Tensorflow 训练 csv 数据进行预测?
- sql - IBM Cognos Analytics 从数据集中选择前 2 个
- mqtt - Mosquitto MQTT 代理不承认外部连接(甚至是本地连接)
- windows - 在 Windows 10 下更改高 DPI 缩放覆盖属性
- python - 使用 Apache NiFi ExecuteStreamCommand 将 CSV 转换为 JSON - Python
- julia - MethodError:Julia 中 JuMP 的一些问题
- php - 将项目添加到 Laravel 中的每个对象
- excel - Azure DevOps 工作项详细信息导入(包括格式)