在IAM策略条件中使用Cognito自定义属性作为Principle Tag,当前存在问题。

0

【以下的问题经过翻译处理】 这是配置信息:

  • User Pool custom attribute:** custom:journalSubscription
  • User Pool app client: 具有自定义属性的读/写权限
  • 示例用户:自定义属性 custom:journalSubscription 设置为true
  • 身份池 ABAC 自定义映射:custom:journalSubscription 的“属性名称”- 映射到-> journalSubscription 的“Tag key for principal”
  • IAM 策略:使用“StringEquals”条件,其中“aws:PrincipalTag/journalSubscription”必须等于“true”

问题现象:SDK 调用失败并显示以下错误消息:

User: <<AUTH_ROLE>> is not authorized to perform: dynamodb:GetItem on resource: <<ARN_FOR_MY_DynamoDB_TABLE>> because no identity-based policy allows the dynamodb:GetItem action

**注意: 使用非自定义属性如 "aws:PrincipalTag/email" 的 IAM 策略时,SDK 调用正常。但对于自定义属性,调用会失败。

如何解决此问题?

1 回答
0

【以下的回答经过翻译处理】 在应用程序客户端设置中,对于“OpenID Connect 作用域”,添加“profile”。这允许应用程序客户端检索“profile”属性,其中包括自定义属性。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则