django socialauth twitter, google oauth, facebook does not work


This is my first post, and I have a problem I could not make it work django OMAB socialauth of three things I just need to google, facebook, and twitter, google works well with open id, but not much twitter and I put in my

settings. py:

TWITTER_CONSUMER_KEY              = '00' this is no real
TWITTER_CONSUMER_SECRET           = '00' this is no real
FACEBOOK_APP_ID                   = '' ihave no key
FACEBOOK_API_SECRET               = ''
LINKEDIN_CONSUMER_KEY             = ''
ORKUT_CONSUMER_KEY                = ''
ORKUT_CONSUMER_SECRET             = ''ihave no key
GOOGLE_OAUTH2_CLIENT_ID           = ''
SOCIAL_AUTH_DEFAULT_USERNAME      = 'socialauth_user'
SOCIAL_AUTH_COMPLETE_URL_NAME     = 'socialauth_complete'
LOGIN_ERROR_URL                   = '/login/error/'
#SOCIAL_AUTH_USER_MODEL            = 'app.CustomUser'
SOCIAL_AUTH_ERROR_KEY             = 'socialauth_error'
GITHUB_APP_ID                     = ''
GITHUB_API_SECRET                 = ''

LOGIN_URL          = '/login-form/'
LOGIN_ERROR_URL    = '/login-error/'

I am using the example that comes in the zip of OMAB socialauth django , but not working.

When I created my twitter app, I wrote my domain , I am testing locally socialauth django ie, then sign in with twitter sends me to this url: and a message saying is the Incorrect authentication service

this happens with facebook and google oauth and oauth2

I'm new to django and I this much work comprising this part of django socialath hopefully help me, thank you very much.

You need to be more specific on "why it doesn't work". Where are you getting the errors?

When debugging a third-party oauth/openid app in Django, generally it boils down to:

  • configuration & keys - did you make sure to obtain all of the necessary API keys for the services you will be using, and to add them to your configuration?
  • urls - did you remember to add the necessary urlpatterns to your base file?
  • authentication setup on the server - often, you'll need to have a file available or respond with a specific header when the authentication service hits your server. Have you checked to make sure that is set up?
  • databases - have you run syncdb after installing the app? Are all the tables set up?
  • templates - if the third party app requires you to set up templates, do you have them set up?
  • custom views - are you using custom views? If so, try using the built-in views that came with the third party app first, to see if they work

After those are confirmed, you're going to want to be able to see what requests are taking place. Use the debugger included in Chrome/Safari, or get the web developer add-on for Firefox, and look at the network requests as they happen. Do you see HTTP responses other than 200 (say, 404, 500, 403, etc?) those mean that the services aren't responding correctly.

From your error, it looks like you have not correctly set up your callback URL on Twitter. It should be sending you to, not Alternatively, check the URL when you get to the Twitter login page -- is the callback URL in the URL, and is it pointing to Then Django is sending it the wrong callback URL.

Finally this:

I wrote my domain python does not support this

Is unclear. As far as I know, Python doesn't care what the domain is.


Are you using runserver? Are you getting the following error?

Error: "" is not a valid port number or address:port pair.

If so, there is an easy fix! Just run it like so:

python runserver

That should resolve your error if that's what's happening. You're probably running it as

python runserver is a reserved IP address that points back to localhost, your own computer. As a result, it is not possible to use it for authentication or any other purpose outside of programs running on your own machine. See this article for more info.