在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 Antwort
0

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

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen