1

I would like to allow users of my website see a special "Image/Video/HTML" but only if they login through facebook connect on my Rails site...

I would like to use Amazon S3 to store the media.. My question is how do I give limited access to my users only if they are logged in? Once they have the URL of the "Image/Video/HTML" I would not like them to be able to access it unless they are logged in with facebook on my site..

Also, will I be able to continue this kind of private site if I want to use Amazon Cloudfront?

This is a starting point for whitelisting only my domain... but I want to make sure the user is logged in through fb connect in order to serve them the appropriate resource...

https://gist.github.com/3716433

sambehera
  • 959
  • 3
  • 13
  • 33

1 Answers1

2

I think this depends on how you're including S3 assets in your app. Here are instructions if you're using paperclip:

https://github.com/thoughtbot/paperclip/wiki/Restricting-Access-to-Objects-Stored-on-Amazon-S3

Here's another question that deals with this issue using the aws-sdk gem:

How to store data in S3 and allow user access in a secure way with rails API / iOS client?

Community
  • 1
  • 1
Dreyfuzz
  • 486
  • 2
  • 13