Facebook login not working properly using django-social-auth
-
14-11-2019 - |
Question
I'm trying to integrate facebook login on a site I'm working on, but so far, it doesn't seem to be working. I'd expect to get something similar to the usual dialog I get like what comes up at the test page at http://social.matiasaguirre.net/
But so far what I'm getting is this
To setup the app on Facebook, I've only added the domain, then under how it integrates with Facebook, I've selected the first option for logging in via Facebook. Then I've copied the id and secret key to my settings file as required by django-social-auth.
My settings file:
SOCIAL_AUTH_ENABLED_BACKENDS = ('facebook', 'twitter')
SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete'
SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete'
SOCIAL_AUTH_DEFAULT_USERNAME = 'socialauth_user'
SOCIAL_AUTH_CREATE_USERS = True
SOCIAL_AUTH_FORCE_RANDOM_USERNAME = False
SOCIAL_AUTH_CHANGE_SIGNAL_ONLY = False
SOCIAL_AUTH_ERROR_KEY = 'socialauth_error'
SOCIAL_AUTH_ASSOCIATE_BY_MAIL = True
AUTHENTICATION_BACKENDS = (
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.facebook.FacebookBackend',
# 'django.contrib.auth.backends.ModelBackend',
'apps.members.backends.Sha256Backend',
)
AUTH_PROFILE_MODULE = 'members.Member'
What could be the problem? I tried running the demo that comes with django-social-auth, and I still get the same results, so my thinking was I'm missing something on Facebook. Any ideas will be appreciated. Thanks.
Update 1
So I've set up the example project that comes with the social auth app, and the error I get is Incorrect authentication service
after I click 'Install' on the auth dialog box
Solution
What you're showing above is the difference between the new enhanced auth dialog and the older dialog. You can change your app setting to use either one.
Go to: https://developers.facebook.com/apps/{appId}/advanced and set the "Enhanced Auth Dialog" setting to Disabled. And now you will get a similar dialog.