0

I'm working with an android device and Amazon's S3 storage system.

I have a main user account and I've creates sub-users to access the storage on the behalf of my user.

Typically, I would use do the following to access S3 with my main user:

AmazonS3Client s3Client = new AmazonS3Client(
                             new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_KEY));
Bucket deviceBucket = s3Client.createBucket(bucketName);

Where ACCESS_KEY_ID and SECRET_KEY are given for my main user's account.

I am trying to do this with my IAM user "Alice". This user was given it own ACCESS_KEY_ID. Using the above code, I user Alice's ACCESS_KEY_ID with the same SECRET_KEY from above. The user Alice has no special permissions or restrictions, thus I assume the user can create buckets.

When createBucket is called, there is an error:

08-08 12:05:55.246: E/AndroidRuntime(2544): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://media/external/images/media/1 }} to activity {com.amazonaws.demo.s3uploader/com.amazonaws.demo.s3uploader.S3UploaderActivity}: Status Code: 403, AWS Service: Amazon S3, AWS Request ID: (somevalue), AWS Error Code: SignatureDoesNotMatch, AWS Error Message: The request signature we calculated does not match the signature you provided. Check your key and signing method., S3 Extended Request ID: (some value)

I cannot seem to find another way to authenticate via Android API to S3 using an IAM user.

ANy help is appreciated, thanks.

2 Answers 2

2

Your IAM user will have a different SECRET_KEY than your root account.

When you created the the IAM account you should have received both an ACCESS_KEY_ID and SECRET_KEY for the account which must be used in combination. The error you received is indicative of a key mismatch or a typo in one of the keys.

Sign up to request clarification or add additional context in comments.

Comments

0

Within AWS ecosystem, permissions are granted explicitly. No permission means the user will not have permission. Access key ID and Secret Key are a combination and no 2 access Keys can have same Secret key.

Use the correct Secret Key for the Access Key.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.