By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Access Denied error when trying to access url with Flutter application

0

I have a flutter project running in an AWS S3 bucket which I can access thanks to its domain https://web.buzoku.store, from said url the redirections work correctly. However, when I try to access a url from the browser, example: https://web.buzoku.store/entrepreneurship/tuyyo access denied occurs

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
</Error>

I have CORS configuration and in Policies Bucket the code that I leave below. So I was hoping it would work, but it doesn't.

CORS
"AllowedOrigins": [
"https://web.buzoku.store/*"
]

Policies Bucket:

{
   "Effect": "Allow",
   "Major": "*",
   "Action": [
       "s3:PutObject",
       "s3:PutObjectAcl",
       "s3:GetObject"
   ],
   "Resource": "arn:aws:s3:::{bucket_name}/*"
}

I'm additionally working with CloudFront, but I didn't see that I could do anything from there. Thanks for the help

asked 8 months ago529 views
2 Answers
0

Hi

  • check that the file 'entrepreneurship/tuyyo' actually exists in your S3 bucket under the correct path. Typos in the URL can lead to this error.
  • Check your policy contains s3:GetObject
  • tuyyo is file should NOT be a FOLDER
  • If you've restricted your S3 bucket to only allow access through CloudFront, you'll need an OAI associated with your distribution, and your bucket policy must grant the OAI read permissions.
  • Temporary The direct URL would look something like https://your-bucket-name.s3.amazonaws.com/entrepreneurship/tuyyo. If this works, the issue is likely with CloudFront.

try those points and let me know if you still have issues

profile picture
EXPERT
answered 8 months ago
  • Hello, well I'll tell you:

    1. The file or path entrepreneurship/tuyyo does not exist because it is a browser path of my Flutter application, with which I will later load using the rest API, I take the pathParam {tuyyo} to load the specific information of the page .
    2. The s3:GetObject policy is configured correctly
    3. Server encryption is Server-side encryption with Amazon S3 managed keys (SSE-S3)
    4. I have access to S3 as public

    I don't know what change there is

0

Hello, well I'll tell you:

The file or path entrepreneurship/tuyyo does not exist because it is a browser path of my Flutter application, with which I will later load using the rest API, I take the pathParam {tuyyo} to load the specific information of the page . The s3:GetObject policy is configured correctly Server encryption is Server-side encryption with Amazon S3 managed keys (SSE-S3) I have access to S3 as public

I don't know what change there is

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions