Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't run the python-social-auth example django app

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.

like image 283
guyf Avatar asked Oct 01 '13 16:10

guyf


People also ask

Is Django-Allauth good?

Django-allauth is one of the most popular authentication packages in the Django world, offering broad functionality for classical and social authentication. It is being developed and actively maintained for over 10 years already, is being used in almost 100.000 projects, and has a large base of contributors.

What is Social_django?

Python Social Auth - Django Python Social Auth is an easy to setup social authentication/registration mechanism with support for several frameworks and auth providers.


1 Answers

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 = '<.....>'
like image 93
mconlin Avatar answered Oct 11 '22 20:10

mconlin