Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook login - email not in user details #368

Open
pbeneteau opened this issue May 7, 2022 · 4 comments
Open

Facebook login - email not in user details #368

pbeneteau opened this issue May 7, 2022 · 4 comments

Comments

@pbeneteau
Copy link

I'm login on Facebook using their SDK on my frontend.

My scopes:

SOCIAL_AUTH_FACEBOOK_SCOPE = ['public_profile', 'email']

The email is requested when the user accept information permission during login process. But when I exchange the access_token using Django social auth, the email isn't included in the data. I only have the username and id.

When I check on my Facebook account settings, after a login, I can see that my email has been provided to the app.

@pbeneteau pbeneteau changed the title Facebook login not providing email Facebook login - email not in user details May 7, 2022
@ghost
Copy link

ghost commented May 14, 2022

For Facebook this is what I have:

SOCIAL_AUTH_FACEBOOK_EXTRA_DATA = [
('name', 'name'),
('email', 'email'),
('picture', 'picture'),
('link', 'profile_url'),
]
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {'fields': 'id, name, email, age_range',}

Not sure if that will solve your issue but I haven't had issues yet. Not a contributor to PSA but hopefully that helps.

@tiago-peres
Copy link

I reckon you were able to solve this issue? I wasn't able to reproduce it but either way you'd have to enforce the email requirement if that is a must.

@ddrr1337
Copy link

For Facebook this is what I have:

SOCIAL_AUTH_FACEBOOK_EXTRA_DATA = [ ('name', 'name'), ('email', 'email'), ('picture', 'picture'), ('link', 'profile_url'), ] SOCIAL_AUTH_FACEBOOK_SCOPE = ['email'] SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {'fields': 'id, name, email, age_range',}

Not sure if that will solve your issue but I haven't had issues yet. Not a contributor to PSA but hopefully that helps.

That solved my problem, thanks for share!

@nijel
Copy link
Member

nijel commented Oct 2, 2023

Would you mind updating the documentation with this? See https://python-social-auth.readthedocs.io/en/latest/backends/facebook.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants