ForbiddenError 403 when getShadow/updateShadow called in AWS IOT

后端 未结 1 1415
甜味超标
甜味超标 2021-01-25 19:19

I have the the authenticated user with federated ID. But when I try to access the AWS IOT stuff I get this error which is driving me crazy.

I am following the iot sample

相关标签:
1条回答
  • 2021-01-25 19:41

    Here are the few reasons why you might be getting error 403

    1. In Cognito, there are no appropriate permissions for Update/Get Shadow both for authenticated and unauthenticated pool
    2. The ARN of the Cognito Pool id as well as the IoT are incorrect
    3. Check the IAM policy and the following policy to the Cognito users, Also for the Cognito user, you have to attach AttachPrincipalPolicy policy to give them appropriate permissions for Get/update the shadow. The policy below should be in the Cognito Auth and UnAuth roles.

      {

      "Version": "2012-10-17",
      "Statement": [
          {
              "Effect": "Allow",
              "Action": [
                  "iot:AttachPrincipalPolicy"
              ],
              "Resource": [
                  "*"
              ]
          }
      ] }
      
    0 讨论(0)
提交回复
热议问题