How do you let only authorized user have access contents stored in Amazon's S3?

一世执手 提交于 2019-12-04 08:09:21

问题


Once you stored contents in S3 and make it public, then everyone have access to it. Is there a way to let only authorized users have access to the content stored in S3? For example, I have a site that let people store their documents. The server stores these documents in S3 and I would like only the user who uploaded the document to have access to it.

I know I can copy the S3 contents to my server and let only authorized users have access, but this will make the server slow. I would like to be able server the contents directly to the client's browser from the S3.

Thanks.


回答1:


The link given in the above answer is no longer correct -- Amazon had it's documentation reorganized. I think these are the correct pages to read:

  • http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/index.html?RESTAuthentication.html#RESTAuthenticationQueryStringAuth
  • http://s3.amazonaws.com/doc/s3-developer-guide/RESTAuthentication.html



回答2:


You want to read the section called 'Query String Request Authentication Alternative' found here

It explains how to create a time-based expiring link to an S3 object

You would then have to write the code that manages the users (the who owns which object part of your question).



来源:https://stackoverflow.com/questions/2511329/how-do-you-let-only-authorized-user-have-access-contents-stored-in-amazons-s3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!