开发者

Canvas authorization error 191

I'm trying to implement a canvas page on facebook. The Canvas tutorial says that I should set the redirect_url to the canvas page:

h开发者_运维百科ttp://apps.facebook.com/<appName>

However, when I do that, I get error 191. If I set it to the canvas url http://www.<mysite>.com/fbCanvas instead, then I lose the Facebook interface, since it opens in the "top" window. What's the correct way to implement this functionality? Is this a bug with Facebook?


I had the same problem, and I solved it this way:

Open FBUtils.php and go to line 94, it reads

echo("<script> top.location.href='" . $authorize_url . "'</script>");

replace it by

echo("<script> window.location.href='" . $authorize_url . "'</script>");

and that's all, you won't get off of FB and your app will be inside the iframe!


This is not a normal behavior, your canvas page may be doing something to get rid of the Facebook frame, like setting window.top.location with Javascript etc.


The redirect_url is used to redirect users after the auth process. You can not use facebook page as redirect destination. The redirect_url must be in same domain as your original canvas page. Then you can redirect the user after the auth process from your domain to the relevant facebook page.

1, The apps.facebook.com/appName running until you redirect user to FB AUTH process page

2, FB AUTH PAGE redirect the user (after the auth process) to http://www.mysite.com (you should implement the Authentication here)

3, You should reidrect the user to apps.facebook.com/appName back

This flow the most flexible, but little bit difficult to handle if you have more than canvas access point (tab, or webpage).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜