Pergunta

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.

Foi útil?

Solução

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 = '<.....>'
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top