【发布时间】:2018-08-27 06:15:35
【问题描述】:
我使用 Django all-auth 登录 Twitter 和 Google。 现在遇到 Facebook 问题。 尝试了 localhost/127.0.0.1/etc 之间的每一个组合(也通过将我的主机更改为 local.domain.com 走极端路线 - 甚至因为 Facebook 显然阻止了 http 访问(自 2018 年 3 月起),所以进行了 SSL 操作。
到此为止...现在我收到此错误 谁能引导我走向正确的方向? 我要拔头发了。
KeyError at /accounts/facebook/login/token/ 'access_token' Request Method: POST Request网址:https://localhost:8000/accounts/facebook/login/token/Django 版本:2.0.3 异常类型:KeyError 异常值:
'access_token'
{'error': {'code': 5,
'fbtrace_id': 'Bs4PHOvc+rZ',
'message': "This IP can't make requests for that application.",
'type': 'OAuthException'}}
添加详情:
http://localhost:8000/accounts/facebook/login/callback
SOCIALACCOUNT_PROVIDERS = {
'facebook': {
'METHOD': 'js_sdk',
'SCOPE': ['email', 'public_profile', 'user_friends'],
'AUTH_PARAMS': {'auth_type': 'reauthenticate'},
'INIT_PARAMS': {'cookie': True},
'FIELDS': [
'id',
'email',
'name',
'first_name',
'last_name',
'verified',
'locale',
'timezone',
'link',
'gender',
'updated_time',
],
'LOCALE_FUNC': lambda request: 'en_GB',
'EXCHANGE_TOKEN': True,
'VERIFIED_EMAIL': False,
'VERSION': 'v2.5',
}
}
【问题讨论】:
-
“此 IP 无法为该应用程序发出请求。” - 听起来您在应用仪表板的“服务器 IP 白名单”中输入了一些内容,但实际上并没有从现在开始匹配您尝试发出请求的 IP。
标签: django facebook authentication django-allauth account