omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

Facebook login fails with KeyError: 'access_token' #1094

Closed ajoyoommen closed 7 years ago

ajoyoommen commented 7 years ago

This is the stack trace:

Internal Server Error: /complete/facebook/
Traceback (most recent call last):
  File "/home/ec2-user/project/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ec2-user/project/venv/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/ec2-user/project/venv/local/lib/python2.7/site-packages/social/apps/django_app/utils.py", line 52, in wrapper
    return func(request, backend, *args, **kwargs)
  File "/home/ec2-user/project/venv/local/lib/python2.7/site-packages/social/apps/django_app/views.py", line 20, in complete
    redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
  File "/home/ec2-user/project/venv/local/lib/python2.7/site-packages/social/actions.py", line 43, in do_complete
    user = backend.complete(user=user, *args, **kwargs)
  File "/home/ec2-user/project/venv/local/lib/python2.7/site-packages/social/backends/base.py", line 40, in complete
    return self.auth_complete(*args, **kwargs)
  File "/home/ec2-user/project/venv/local/lib/python2.7/site-packages/social/backends/facebook.py", line 71, in auth_complete
    access_token = response['access_token']
KeyError: 'access_token'
nony05 commented 7 years ago

+1

sametersan commented 7 years ago

+1

scottlinux commented 7 years ago

Does the latest python-social-auth work? (0.3.6)

scottlinux commented 7 years ago

Try python-social-auth==0.2.21

ajoyoommen commented 7 years ago

I was unable to upgrade to latest. However, upgrading to 0.2.19 worked and also solved this issue.