KeyError 'oauth_token' when logging in to Twitter
harrisbaird opened this issue · 2 comments
The error occurs for both Twitter and Linkedin. Everything else is works fine.
Traceback:
Environment:
Request Method: GET
Request URL: http://www.mydomain.com/accounts/twitter_login/?next=/
Django Version: 1.2.3
Python Version: 2.6.6
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.comments',
'socialauth',
'openid_consumer',
'commentor',
'example',
'example_comments']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'openid_consumer.middleware.OpenIDMiddleware',
'django.middleware.csrf.CsrfViewMiddleware')Traceback:
File "/home/ubuntu/env/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
100.> > > > > response = callback(request, _callback_args, *_callback_kwargs)
File "/home/ubuntu/env/lib/python2.6/site-packages/django_socialauth-0.1.2c-py2.6.egg/socialauth/views.py" in twitter_login
90.> request_token = twitter.fetch_request_token(callback=request.build_absolute_uri(reverse('socialauth_twitter_login_done')))
File "/home/ubuntu/env/lib/python2.6/site-packages/django_socialauth-0.1.2c-py2.6.egg/socialauth/lib/oauthtwitter2.py" in fetch_request_token
46.> > return oauth.OAuthToken.from_string(oauth_response(oauth_request))
File "/home/ubuntu/env/lib/python2.6/site-packages/oauth/oauth.py" in from_string
142.> > key = params['oauth_token'][0]Exception Type: KeyError at /accounts/twitter_login/
Exception Value: 'oauth_token'
Never mind, I've managed to get it working.
I had this error too.
It was coz Callback URL: wasnt filled on twitter.