简体   繁体   中英

AWS S3 using JavaScript SDK: listObjects for unauthenticated, public users

AWS JavaScript SDK has methods for listing all objects in an S3 bucket, but you have to use this method as an authenticated IAM.

Is there a way to create an IAM that can be assumed by any public user and then use that IAM to list the contents of the bucket?

Or is there any other way to list the contents of the bucket publicly using the front-end JavaScript SDK?

我认为做到这一点的方法是使用Amazon Cognito ,它允许“来宾”访问API。

I know this is kind of old but I just found this: https://github.com/aws/aws-sdk-js/commit/7a8e257f32d984821a8661422070fb861659015f

It's a method for the AWS.S3() javascript sdk object, so one can make unathenticated requests to the api. Works great with public buckets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM