Email is empty in login with Facebook

16 views
Skip to first unread message

Martin Peveri

unread,
Apr 7, 2016, 9:15:33 PM4/7/16
to python-social-auth

When login with Facebook, the email is always empty:

This is my 'details' response:

{'fullname': 'name', 'first_name': 'first_name', 'username': 'username', 'email': '', 'last_name': 'last_name'}

The graph say 'granted':

image

My settings.py:

AUTHENTICATION_BACKENDS = (
'social.backends.facebook.FacebookAppOAuth2',
'social.backends.facebook.FacebookOAuth2',
'social.backends.google.GoogleOpenId',
'social.backends.google.GoogleOAuth2',
'social.backends.google.GoogleOAuth',
'django.contrib.auth.backends.ModelBackend',
)

SOCIAL_AUTH_URL_NAMESPACE = 'social'

SOCIAL_AUTH_LOGIN_REDIRECT_URL = "/"

SOCIAL_AUTH_LOGIN_URL = "/"

SOCIAL_AUTH_EMAIL_VALIDATION_FUNCTION = 'apps.main.mail.send_validation'
SOCIAL_AUTH_EMAIL_VALIDATION_URL = '/email_sent/'
SOCIAL_AUTH_FORCE_EMAIL_VALIDATION = True

SOCIAL_AUTH_PROTECTED_USER_FIELDS = ['email']

SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']

SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.auth_allowed',
'social.pipeline.social_auth.social_user',
'social.pipeline.user.get_username',
'apps.main.pipelines.require_email',
'apps.main.pipelines.custom_mail_validation',
'social.pipeline.social_auth.associate_by_email',

'social.pipeline.user.create_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details',
'apps.main.pipelines.login'
)

Any idea?

Thanks!

Reply all
Reply to author
Forward
0 new messages