We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am getting the following error:
Environment:
Request Method: GET Request URL: http://localhost/api/social/complete/yahoo-oauth/?oauth_token=qgf9qgm&oauth_verifier=xqmcyd
Django Version: 1.6 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', 'django.contrib.admin', 'corsheaders', 'yahoo_app') 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', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware', 'corsheaders.middleware.CorsMiddleware', 'middleware.crossdomainxhr.XsSharing')
Traceback: File "/home/lladmin/hanu_api/shared/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
return view_func(_args, *_kwargs)
return func(request, backend, _args, *_kwargs)
redirect_name=REDIRECT_FIELD_NAME, _args, *_kwargs)
_args, *_kwargs)
return self.backend.auth_complete(_args, *_kwargs)
return self.do_auth(access_token, _args, *_kwargs)
return self.strategy.authenticate(_args, *_kwargs)
return authenticate(_args, *_kwargs)
user = backend.authenticate(**credentials)
return self.pipeline(pipeline, _args, *_kwargs)
out = self.run_pipeline(pipeline, pipeline_index, _args, *_kwargs)
result = func(_args, *_out) or {}
return {'details': strategy.backend.get_user_details(response)}
email = response.get('emails')[0]['handle']
Exception Type: KeyError at /social/complete/yahoo-oauth/ Exception Value: 'handle'
Above error comes because the response from yahoo contains a list with emails like the following:
response {'access_token': {u'oauth_authorization_expires_in': u'_667', u'oauth_expires_in': u'3600', u'oauth_session_handle': u'__', u'oauth_token': u'__', u'oauth_token_secret': u'*_39b', u'xoauth_yahoo_guid': u'_6GM'}, u'created': u'2010-01-22T08:24:16Z', u'emails': [{u'id': 1, u'type': u'HOME'}, {u'handle': u'__ter@yahoo.com', u'id': 2, u'primary': True, u'type': u'HOME'}, {u'id': 7, u'type': u'HOME'}], u'familyName': u'_****', ...}
I suggest iterate over the list of emails and check which element contains the handle key.
The text was updated successfully, but these errors were encountered:
Btw if I use this Backend with a new Yahoo account the error is not raised, only with my Old Yahoo account.
Hope this can help, thanks for such great job with Python social auth.
Sorry, something went wrong.
3131d77
@roberto-robles, the change above should fix your issue. Thanks for the report!
No branches or pull requests
I am getting the following error:
Environment:
Request Method: GET
Request URL: http://localhost/api/social/complete/yahoo-oauth/?oauth_token=qgf9qgm&oauth_verifier=xqmcyd
Django Version: 1.6
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',
'django.contrib.admin',
'corsheaders',
'yahoo_app')
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',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'corsheaders.middleware.CorsMiddleware',
'middleware.crossdomainxhr.XsSharing')
Traceback:
File "/home/lladmin/hanu_api/shared/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: KeyError at /social/complete/yahoo-oauth/
Exception Value: 'handle'
Above error comes because the response from yahoo contains a list with emails like the following:
response
{'access_token': {u'oauth_authorization_expires_in': u'_667',
u'oauth_expires_in': u'3600',
u'oauth_session_handle': u'__',
u'oauth_token': u'__',
u'oauth_token_secret': u'*_39b',
u'xoauth_yahoo_guid': u'_6GM'},
u'created': u'2010-01-22T08:24:16Z',
u'emails': [{u'id': 1, u'type': u'HOME'},
{u'handle': u'__ter@yahoo.com',
u'id': 2,
u'primary': True,
u'type': u'HOME'},
{u'id': 7, u'type': u'HOME'}],
u'familyName': u'_****',
...}
I suggest iterate over the list of emails and check which element contains the handle key.
The text was updated successfully, but these errors were encountered: