Blasanka / aws_s3_plugin

This is a plugin created for file upload to AWS S3
Other
10 stars 13 forks source link

Access Denied (Service: Amazon S3; Status Code: 403) though Cognito pool ID #7

Open wann2 opened 4 years ago

wann2 commented 4 years ago

I used cognito pool ID, but when I try to upload a file to s3, onError: com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied

In native Android app, the same cognito pool id can upload any file to s3 is ok.

IAmSarthakVerma commented 4 years ago

I am also encountering the same error. @wann2 @Blasanka Can anyone of you assist me here.

Blasanka commented 4 years ago

@wann2 @IAmSarthakVerma Sre you guys using the correct region related to Pool id?

moraesjeremias commented 3 years ago

I'm facing this same issue @Blasanka, even though setting all Cognito, S3 and IAM roles policies allowing S3 Putting Objects. I'm using the same region as well.

RishabGuggali commented 3 years ago

@Blasanka @wann2 I am also getting the same error

D/UploadTask(32647): Failed to upload: 6 due to Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 1AC7FB214CD42697)

How can I solve this?

moraesjeremias commented 3 years ago

ask(32647): Failed to upload: 6 due to Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 1AC7FB214CD42697)

How can I solve this?

Hey @RishabGuggali I solved by using AWS Cognito Dart 2 and Dio by following this thread in StackOverFlow.

Unfortunately I'm facing a issue with the Time to Live (TTL) of AWS Session Token, which is fundamental for making api calls using AWS Cognito Dart 2, and I didn't have time to go over that in depth. Tough you do can upload files to AWS s3, you may have to renew AWS Session Token at most in 3 days (max TTL), which is time consuming and not suitable for production workloads. We can study a solution for this issue together, what do you say?