我正在尝试通过 BitBucket、Github、LinkedIn 实现社交媒体身份验证,并且在 /login/error/ 处收到错误 WrongBackend,LinkedIn 和 Bitbucket 和 QueryDict 的身份验证服务“错误”:{u'error': [u'用于 Github 的 redirect_uri_mismatch']}。
我使用 MongoEngine 作为数据库存储
这是 Bitbucket 的回溯(与 LinkedIn 类似)
Environment:
Request Method: GET
Request URL: http://localhost:8000/login/error/
Django Version: 1.4.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'blogapp',
'social_auth')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/social_auth/decorators.py" in wrapper
29. raise WrongBackend(backend)
Exception Type: WrongBackend at /login/error/
Exception Value: Incorrect authentication service "error"
我在异常“/usr/local/lib/python2.7/dist-packages/social_auth/decorators.py”的位置添加了一个跟踪,并得到了以下跟踪。任何人都可以让我知道我要去哪里错了吗?这非常令人沮丧。
我的应用程序具有以下设置
在所有服务中,我已将我的应用程序 url 注册为 localhost:8000 并将回调 url 注册为 localhost:8000/callback/
[编辑]
我创建了一个答案中提到的 sqlite3 表,它创建了一些表。但问题依然存在。