简体   繁体   English

AWS凭证无法从android示例应用程序正常工作

[英]aws credentials are not working from android sample app

I am using the sample app provided from the AWS MOBILE HUB and when I run it works. 我正在使用AWS MOBILE HUB提供的示例应用程序,并且在运行时可以运行。 But whenever i copy the amazonaws folder to my project I get an error with regards to the credentials. 但是每当我将amazonaws文件夹复制到我的项目时,我都会收到有关凭据的错误消息。 This the error i get when i try to run a query to dynamodb 当我尝试对dynamodb运行查询时出现此错误

    Caused by: com.amazonaws.AmazonServiceException: User: arn:aws:sts::033145769257:assumed-role/getitdelivery_unauth_MOBILEHUB_927752501/CognitoIdentityCredentials is not authorized to perform: dynamodb:Query on resource: arn:aws:dynamodb:us-east-1:033145769257:table/getitdelivery-mobilehub-927752501-Deliveries/index/Todays_Order (Service: AmazonDynamoDB; Status Code: 400; Error Code: AccessDeniedException; Request ID: JEDMKDQ6JMOTVPIMF85VJHSMGFVV4KQNSO5AEMVJF66Q9ASUAAJG)

You should take a look at your IAM Policy. 您应该看看您的IAM政策。 Mobile Hub configures all of this for you with their generated sample application, but since you copied some things to your own project, you might need to update the policy so that your unauth role has permission to do: dynamodb:Query on resource: arn:aws:dynamodb:us-east-1:033145769257:table/getitdelivery-mobilehub-927752501-Deliveries/index/Todays_Order . Mobile Hub使用其生成的示例应用程序为您配置了所有这些功能,但是由于您已将某些内容复制到自己的项目中,因此可能需要更新策略,以便您的unauth角色有权执行以下操作: dynamodb:Query对资源的dynamodb:Queryarn:aws:dynamodb:us-east-1:033145769257:table/getitdelivery-mobilehub-927752501-Deliveries/index/Todays_Order

An example of what the policy should look like is found here: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/using-identity-based-policies.html 可在以下位置找到该政策的示例: http : //docs.aws.amazon.com/amazondynamodb/latest/developerguide/using-identity-based-policies.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM