6

Apologies for the basic question. I am a user of django-social-auth but can't get python-social-auth off the ground.

I have downloaded the example app, successfully sync'ed the db, and added my working facebook, linkedin and twitter app keys to settings. When I run the app I get the sample homepage with all the social media links.

When click facebook OAuth2 I get an http error: 400 Client Error: Bad Request. Implying that url callback into my server to (/complete/facebook/) is badly formed.

When I click LinkedIn or Twitter I get http error: 401 Client Error: Unauthorized.

Have I missed a bit of the config? Has anyone got the example app working out of the box?

Thanks - Guy.

guyf
  • 81
  • 1
  • 8
  • I just tried it using google oauth2 and got a "Error: redirect_uri_mismatch". The only setting I altered was adding SOCIAL_AUTH_GOGGLE_OAUTH2_KEY and _SECRET. – mconlin Oct 04 '13 at 11:07
  • Can you please share the source code for your app. – Sandeep Feb 03 '14 at 06:10

1 Answers1

4

Did you set your secret and key for LinkedIn and Twitter in your settings.py?

Once that is done you may have to set the redirect urls with those providers.

I tested with google and had to fix my Google API Access settings.

I changed redirect urls to http://localhost:8000/complete/google-oauth2/

UPDATE: I am having issues with LinkedIn on oauth1 & 2. There doesnt appear to be a way to get the required API key into the request. I have attempted to hard code in the oauth1_auth.py of requests_oauthlib but with no success yet.

UPDATE 2: Twitter worked for me by making sure my twitter developer application settings had "Allow this application to Sign in with Twitter" checked and my consumer key and secret set in my settings.py like so:

# TWITTER
#
SOCIAL_AUTH_TWITTER_KEY = '<...>'
SOCIAL_AUTH_TWITTER_SECRET = '<.....>'
mconlin
  • 8,169
  • 5
  • 31
  • 37
  • Thanks @mcolin slight embarrassingly I did have a mistake in my settings keys, once sorted authentication with facebook, linkedin (oauth1) and twitter all worked fine. Although any extra data I request from linkedin at authentication time currently comes through as null. – guyf Oct 07 '13 at 16:08
  • I'm not quite sure that setting "localhost:8000" as a valid redirect_uri is a good solution, instead you should try telling python-social-auth to send the correct redirect_uri parameter instead of localhost:8000. I'm not aware on how to do this though. – licorna Oct 29 '13 at 20:49
  • Unable to use django-social-auth http://stackoverflow.com/questions/21515035/login-via-google-and-facebook-using-django-social-auth – Sandeep Feb 03 '14 at 06:09
  • thanks for some reason i did not have this labeled right. The transition from django-social-auth to python-social-auth must have thrown me. – Chris Hawkes Feb 05 '15 at 01:02