qoomon / aws-s3-bucket-browser

Single page application to browse AWS S3 bucket content
https://qoomon.github.io/aws-s3-bucket-browser/index.html?bucket=https://s3.amazonaws.com/spacenet-dataset#
MIT License
246 stars 85 forks source link

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). #36

Closed Dhyanesh97 closed 2 years ago

Dhyanesh97 commented 2 years ago

image

I have configured s3 Static website + CloudFront with lambda@Edge + aws cognito. When I open Cloudfront URL after authenticating with cognito it shows above errors that it is not able to load the page due to security issues.

Link to refer: https://medium.com/@saurishkar/setting-up-aws-http-authentication-on-cloudfront-s3-using-cognito-and-lambda-edge-166ee38d471e

added below line to HTML but still gives an error.

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' * ">

image

Any help appreciated.

qoomon commented 2 years ago

I think this is not related to this project, it is rather a general problem. You could open an stackoverflow question.

tcarrondo commented 2 years ago

@Dhyanesh97 see if this helps: https://github.com/aws-samples/cloudfront-authorization-at-edge/issues/197 https://github.com/aws-samples/cloudfront-authorization-at-edge/issues/73