How do I Restrict Access to My Static Website on Amazon S3 by asking for Credentials

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 01:16:13

问题


I'm hosting a Static Website on AmazonS3 (http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html).

However, I wish to grant access to my page ONLY by authorizing and subsequently authenticating users.

What services are available (Heroku, etc.,) that allows me to do that? I would like the option of having login using their social networking IDs (facebook, twitter, etc.,).

Thanks for your direction on this.


回答1:


The scenario you describe cannot be achieved purely via Amazon S3.

While there is security available in Amazon S3, it uses either:

  • AWS credentials (that should not be issued to your application users), or
  • Pre-Signed URLs that grant users temporary access to objects in Amazon S3 (but they need to be generated by an application)

You will need an application that accepts their login and verifies the level of access they are permitted. The application can then generate pre-signed URLs to grant access to specific objects in Amazon S3. The traditional way to provide such an application is on a web server running on Amazon EC2. (An alternative is to use Serverless code. Here is an example)

You could use Web Identity Federation to authenticate users via Facebook, Google and Amazon, as part of the above process.



来源:https://stackoverflow.com/questions/35027961/how-do-i-restrict-access-to-my-static-website-on-amazon-s3-by-asking-for-credent

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