GithubHelp home page GithubHelp logo

Twitter - oauth_token about django-social-auth HOT 5 CLOSED

omab avatar omab commented on September 26, 2024
Twitter - oauth_token

from django-social-auth.

Comments (5)

omab avatar omab commented on September 26, 2024

It's still reproducible?

from django-social-auth.

richardjpope avatar richardjpope commented on September 26, 2024

Yes.

Environment:

Request Method: GET
Request URL: http://localhost:8000/login/twitter/
Django Version: 1.2.4
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.flatpages',
'django.contrib.gis',
'social_auth',
'main']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')

Traceback:
File "/data/vhost/newsblocks/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/data/vhost/newsblocks/lib/python2.6/site-packages/social_auth/views.py" in auth
  2. return auth_process(request, backend, complete_url, redirect)
    
    File "/data/vhost/newsblocks/lib/python2.6/site-packages/social_auth/views.py" in auth_process
  3.     return HttpResponseRedirect(backend.auth_url())
    
    File "/data/vhost/newsblocks/lib/python2.6/site-packages/social_auth/backends/init.py" in auth_url
  4.     token = self.unauthorized_token()
    
    File "/data/vhost/newsblocks/lib/python2.6/site-packages/social_auth/backends/init.py" in unauthorized_token
  5.     return OAuthToken.from_string(response)
    
    File "/data/vhost/newsblocks/lib/python2.6/site-packages/oauth/oauth.py" in from_string
  6.     key = params['oauth_token'][0]
    

Exception Type: KeyError at /login/twitter/
Exception Value: oauth_token

from django-social-auth.

omab avatar omab commented on September 26, 2024

The only way I could reproduce this one is disabling TWITTER_CONSUMER_KEY or TWITTER_CONSUMER_SECRET, check your settings please.

Take a look to Twitter section on README.

from django-social-auth.

richardjpope avatar richardjpope commented on September 26, 2024

After much digging I tracking it down to a bug on the Twitter app registration page.

If you do not specify a Callback URL then Twitter changes the type of app from 'Browser' to 'Client' which then produced the result reported above.

I have reported this to Twitter, but it might be worth amending the readme in the meantime.

from django-social-auth.

omab avatar omab commented on September 26, 2024

Doc updated in 795f0c2

from django-social-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.