python 为什么我的 Facebook 应用程序出现错误 104(“无效签名”)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2087672/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 23:44:29  来源:igfitidea点击:

Why is my Facebook application with error 104 ("invalid signature")?

pythonauthenticationfacebookcherrypypyfacebook

提问by larsks

I am trying to develop a Facebook application using PyFacebook (hosted on Google App Engine). It's an FBML application (runs in a Facebook canvas instead of an iframe). I'm having problems getting any API calls to function. The sequence looks like this:

我正在尝试使用 PyFacebook(托管在 Google App Engine 上)开发 Facebook 应用程序。这是一个 FBML 应用程序(在 Facebook 画布而不是 iframe 中运行)。我在调用任何 API 时遇到问题。序列如下所示:

fb = facebook.Faceboook(api_key, secret_key)
fb.session_key = cherrypy.request.params['fb_sig_session_key']
fb.uid =cherrypy.request.params['fb_sig_user']

Then if I try, for example:

然后,如果我尝试,例如:

user = fb.users.getLoggedInUser()

This will fail with:

这将失败:

Error 104: Incorrect signature

I'm not sure where I'm going wrong. I've verified that the api_key and secret_key are correct (many, many times). The application has been added to my account. I've even been able to get a desktop application working; my problem is only with this web-hosted version.

我不确定我哪里出错了。我已经验证了 api_key 和 secret_key 是正确的(很多很多次)。该应用程序已添加到我的帐户中。我什至能够让桌面应用程序工作;我的问题仅与此网络托管版本有关。

Thanks for your help!

谢谢你的帮助!

采纳答案by larsks

Deleting the Facebook application and re-creating it, then configuring my code with the new API key and secret key, resolved this problem.

删除 Facebook 应用程序并重新创建它,然后使用新的 API 密钥和密钥配置我的代码,解决了这个问题。