I'm stuck trying to use AWS with iOS for 2 days now. I downloaded a sample project from here: https://github.com/awslabs/aws-sdk-ios-samples
I did the same as the steps, I used cocoapods to link all the libraries.
I also created a bucket and again followed the steps on how to get the identifier in order to change it in the code, as shown below:
AWSCognitoCredentialsProvider *credentialsProvider = [AWSCognitoCredentialsProvider credentialsWithRegionType:AWSRegionUSEast1 accountId:AWSAccountID identityPoolId:CognitoPoolID unauthRoleArn:CognitoRoleUnauth authRoleArn:nil];
So basically, when I try to upload some images / files (in the example using Amazon's S3 storage service, I get an error:
2014-09-04 15:11:57.475 S3TransferManagerSample[5437:400b] AWSiOSSDKv2 [Error] AWSCredentialsProvider.m line:356 | __40-[AWSCognitoCredentialsProvider refresh]_block_invoke299 | Unable to refresh. Error is [Error Domain=com.amazonaws.AWSSTSErrorDomain Code=0 "The operation couldn't be completed. (com.amazonaws.AWSSTSErrorDomain error 0.)" UserInfo=0x14d17770 {Type=Sender, Message=Not authorized to perform sts:AssumeRoleWithWebIdentity, __text=( "\n ", "\n ", "\n ", "\n " ), Code=AccessDenied}]
To be clear, I already created a role and gave it a policy: AdministratorAccess and used the role ARN to set
unauthRoleArn:CognitoRoleUnauth
I read the documentation and can't seem to find the problem. I have a feeling that it has something to do with the role and politics attached to the role.
I would really appreciate any advice on how to get started or how to solve this problem.
Thank you, and if you need more information about the question, do not hesitate to comment, and I will give more, since the question was a little long.