S3 Sample Manager Shows Error: Unauthenticated Access Not Supported

I am trying to run AWS android samples from the following git repository: https://github.com/awslabs/aws-sdk-android-samples

I get the following error message:

Unauthenticated access is not supported. (Service: AmazonCognitoIdentityService; Status code: 400; Error code: NotAuthorizedException; Request ID: 75be66eb-11b6-11e4-85d9-9933082e5eb2)

I configured AWS according to the steps given in the git url repository: https://github.com/awslabs/aws-sdk-android-samples/blob/master/S3_TransferManager/README.md

I have included the following libraries in libs:

  • AWS-android-SDK-2.0.4-cognito.jar
  • AWS-android-SDK-2.0.4-core.jar
  • AWS-android-SDK-2.0.4-s3.jar

I also added AWS_ACCOUNT_ID , COGNITO_POOL_ID and BUCKET_NAME . I was not sure where to find COGNITO_ROLE_UNAUTH , so I left it at YOUR_COGNITO_UNAUTH_ROLE .

Can someone tell me what I'm doing wrong here?

+8
android amazon-s3 amazon-web-services amazon-cognito
source share
1 answer

Sorry to have problems with the sample. There are two things that I think can solve your problem.

First, have you included unauthorized access in the Congito identifier pool? You can check by going to the Cognito console, going to the Edit Identity Pool and seeing if Enable access to Unauthenticated Identities .

Secondly, you need to set COGNITO_ROLE_UNAUTH . To do this, you first need to go to the IAM console and create a role if you do not already have it. Then click the role in the IAM console and click Summary . The first thing on the Summary tab should be Role ARN . Replace YOUR_COGNITO_UNAUTH_ROLE with the value found there.

Hope this helps, and I will see if we can make the documents clearer. Sorry for the trouble again!

+15
source share

All Articles