jgorset/fandjango — Issue #55: Detect if website is loaded from withing a Facebook canvas
Author: mbaechtold
Created: 2012-03-06 07:45:52+00:00
State: open

A while ago I made a Fandjango powered website which was running inside a Facebook's page tab. It was easy to check if my website was accessed from within Facebook thanks to the `request.facebook.signed_request.page` attribute.

In my current project I'm putting together a Facebook canvas app and I have to check if my page is loaded from within the iframe of the Facebook canvas. Is there a way I could do this as described with a Facebook page tab? I cannot rely on the presence of `request.facebook` alone as this is also loaded from cookies.

Oh and while I'm at it, what do you think about a settings variable to disable the cookie based crafting of `request.facebook`? When this setting's enabled, `request.facebook` would always and only be crafted from the `signed_request` posted by Facebook and one could be sure the website is loaded from within a Facebook Canvas.