I am using python social auth with my django project for providing Facebook login functionality. I can see the email being supplied from facebook in the popup. But it is coming as empty in my partial pipeline. The same code was working fine with my other Facebook app with the exact same settings apart from api version (previously it was 2.3 and now its 2.4). There is no option to change the Facebook api version to 2.3 also. My python-social-auth version is 0.2.12 Following are the relevant data from my settings file
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email',]
FACEBOOK_EXTENDED_PERMISSIONS = ['email',]
SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True
SOCIAL_AUTH_PROTECTED_USER_FIELDS = ['email',]
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/'
SOCIAL_AUTH_LOGIN_ERROR_URL = '/'
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',
'home.pipeline.require_email',
'social.pipeline.social_auth.associate_by_email', # <--- enable this one
'social.pipeline.user.create_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details',
'home.pipeline.send_welcome_mail',
)
SOCIAL_AUTH_FACEBOOK_KEY = os.environ['SOCIAL_AUTH_FACEBOOK_KEY']
SOCIAL_AUTH_FACEBOOK_SECRET = os.environ['SOCIAL_AUTH_FACEBOOK_SECRET']
This is my custom partial pipeline function
@partial
def require_email(strategy, backend, uid, details, user=None, *args, **kwargs):
print details
#some stuff......
This function prints the empty email id as shown below
{'username': u'Anurag Jain', 'fullname': u'Anurag Jain', 'last_name': u'Jain', 'email': '', 'first_name': u'Anurag'}
Can anybody help me figure out the problem with this.