My facebook app is getting redirected out of the iFrame on authorization. I have used the facebook.php and base_facebook.php from gitHub without any change and have pretty much followed example.php. What could I be missing?:

So, the redirect_uri is the current URL (www.myserver.com/myapp/index.php). If I hardcode redirect_uri as apps.facebook.com/myapp, facebook throws an error ("redirect_uri isn't an absolute URI"). Usually people run into this problem if any of their basic app settings are flawed, but I don't see anything wrong. Here are my basic settings: siteurl: myserver.com/myapp namespace: <app name> //so I do have namespace set canvasUrl: myserver.com/myapp secure canvas url: myserver.com/myapp
–
Aamir QuraishiOct 28 '12 at 7:35

when I give a redirect_uri (instead of of current url), I get the error: API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: redirect_uri isn't an absolute URI. Check RFC 3986. I get this error irrespective of giving myserver.com/myapp or apps.facebook.com/namespace I am using https
–
Aamir QuraishiOct 28 '12 at 17:02

The above problem goes away when I change my canvas url to https. But now the application loops infinitely
–
Aamir QuraishiOct 28 '12 at 17:14

1 Answer
1

It is a combination of things you have take care of to solve these two problems:
1. facebook authorization redirecting app out of iFrame (as mentioned by ifaour)
2. app going into a loop
3. app going into a loop only in IE

For (1), everything must be consistently https (or http). I did have my secure canvas url as https but had left my canvas url as http (I thought this was fine). Apparently, both should be https

For (2), the OOB facebook-php integration code at GitHub uses Current URL as redirect_uri. You have to change that to apps.facebook.com/namespace- note that that this has to be done at two places in base_facebook.php - getLoginUrl and getAccessTokenFromCode