I'm interested in using Facebook as a way to validate that someone is my friend on an external site, and based on that, show them special content.
Inside Facebook, consider this scenario:
- I post photos and give permission to friends only
- Someone tries to view my photos by URL
- If that person is my friend, Facebook displays the photos.
I want to mimic this behavior on my own personal website:
- User follows a link to "private" content
- My site (either by server-side, JS, Ajax, iframe, whatever) asks Facebook if the person is logged into Facebook in their browser.
- If not, user is presented with a Facebook popup to log in.
- When the user is logged in, my site asks Facebook if they are my friend (ID coded into the site), and if so, presents them with the content
Is this possible without requiring the user to "authorize" my site or application? My only idea (based on http://wiki.developers.facebook.com/index.php/Authorizing%5FApplications) is that I could create an application for my site, and then on the external site, load my Facebook application in a hidden iframe (which would in turn load my site in an iframe) to give my site the Facebook user ID and store it in the session.
What is the best way to accomplish this?