Cannot start python-social-auth django application

Sorry for the basic question. I am a user of django-social-auth but cannot get python-social-auth from the ground.

I downloaded the sample application, successfully synchronized db, and added my working facebook, connected and twitter application keys to the settings. When I launch the application, I get a sample homepage with all the links on social networks.

When you click facebook OAuth2, I get the error http: 400 Client Error: Bad Request. Assuming the url callback on my server (/ complete / facebook /) is poorly formed.

When I click on LinkedIn or Twitter, I get the error message http: 401 Client error: unauthorized.

Did I miss a little config? Has anyone got an example of an application that works out of the box?

Thanks - Guy.

+6
source share
1 answer

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

Once this is done, you may need to set redirect URLs with these providers.

I tested with google and fixed the access settings for the Google API.

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

UPDATE: I am having problems with LinkedIn on oauth1 and 2. There is no way to get the required API key in the request. I tried to make hard code in the oauth1_auth.py request_oauthlib file, but haven’t done it yet.

UPDATE 2: Twitter worked for me, making sure that my Twitter developer application settings “Allow this application to log in using Twitter” were checked, and my consumer key and secret settings were set in my .py settings, for example:

 # TWITTER # SOCIAL_AUTH_TWITTER_KEY = '<...>' SOCIAL_AUTH_TWITTER_SECRET = '<.....>' 
+4
source

Source: https://habr.com/ru/post/955043/


All Articles