开发者

pyfacebook @facebook.require_login() decorator causing constant auth_token refresh

开发者 https://www.devze.com 2023-02-16 16:36 出处:网络
First time using pyFacebook. I\'ve literally copied the example application and put it up onto my server. I\'ve created an FB app and now when I try to load the app basically what happens is that the

First time using pyFacebook. I've literally copied the example application and put it up onto my server. I've created an FB app and now when I try to load the app basically what happens is that the browser keeps refreshing. I noticed in the url (for example)

https://apps.facebook.com/myapp/?auth_token=8f826cae31717068c18f开发者_如何学编程b16fd7f0a758

Keeps refreshing with the auth_token changing. If I remove the @facebook.require_login() decorator then the page displays without a problem.

Help please.


I've just noticed that it only does this when I select IFrame and not FBML within my app settings. I have fbml templates which don't work. I know have normal html templates which work on the website but when I select IFrame I get that constant loop (changing url with blank white screen)


Ok so after weeks of pain the problem I was having was that Facebook updated it's entire API. This broke python based apps that were based on that. Like PyFacebook.

I now use fandjango and this it's new, has a great developer and nice documentation.


The problem is most probably somewhere in facebook/init.py, around line 1742

    if not params:
        if request.method == 'POST':
            params = self.validate_signature(request.POST)
        if not params:   #was else

iframe makes POST call, but auth_token is GET variable.. though if validate_signature fails (params still None) go to GET validation. Also I commented out the return in auth_token checks as suggested in pyfacebook issue tracker.

0

精彩评论

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