无法使用fbconsole在Facebook上授权
我只是安装,然后尝试他的无法使用fbconsole在Facebook上授权,facebook,authentication,oauth,Facebook,Authentication,Oauth,我只是安装,然后尝试他的fbconsole。自动地\u authenticate功能在Facebook上进行身份验证,但没有运气。我刚刚收到以下错误消息: /var/virtualenvs/jd/src/fbconsole/src/fbconsole.pyc in automatically_authenticate(username, password, app_secret, redirect_uri, debug) 411 oauth["state"][0], st
fbconsole。自动地\u authenticate
功能在Facebook上进行身份验证,但没有运气。我刚刚收到以下错误消息:
/var/virtualenvs/jd/src/fbconsole/src/fbconsole.pyc in automatically_authenticate(username, password, app_secret, redirect_uri, debug)
411 oauth["state"][0], state,
412 )
--> 413 code = oauth["code"][0]
414
415 # 4. Exchange the code for a user access token for this user's data
KeyError: 'code'
我不知道怎么了。我怀疑Facebook应用程序设置可能存在一些问题(例如,我无法将网站URL设置为http://127.0.0.1:8080
value)。我尝试在本地主机和生产服务器上运行此代码。但是错误仍然是一样的(Facebook没有给我code
参数)
有人知道问题出在哪里吗?oauth没有'code'参数,因为在上一步中,我们从facebook获得错误,因为我们使用了过期的应用程序ID(在fbconsole中定义) 正确使用fbconsole.automatically\u身份验证:
import fbconsole.py
fbconsole.APP_ID = 'our APP_ID'
fbconsole.automatically_authenticate('LOGIN','PASS','our APP_SECRET','request_uri')
将
site\u url
设置为http://local.fbconsole.com:8080/
然后使用此代码进行身份验证
import fbconsole as fb
fb.APP_ID = <your app id in quotes>
fb.AUTH_SCOPE = <any list of scopes>
fb.authenticate()
将fbconsole导入为fb
fb.APP_ID=
fb.AUTH_范围=
fb.authenticate()