-
Notifications
You must be signed in to change notification settings - Fork 2k
passport facebook (facebook api v2 & email permission disallowed) #202
Comments
@jcaspian has this been fixed? We've done a lot of OAuth restructuring, so I think some things may have been taken care of. |
@ilanbiala I can see that currently FacebookStrategy is using the user's registered Facebook email address for the profile.username field. E.g. [email protected], "jeff_wong" will be used. As for the second issue mentioned regarding Facebook permission, the problem seems to be still there. To reproduce:
From what I understand this is actually not an issue of MeanJS but developers like us need to deal with it ourselves. For example if user chose not to allow email access, we'll need to tell user the reason that account could not be created because email is required. Then we'll need to revoke the user app permission so that next time when user choose to sign up via Facebook Login again, the permission prompt will be shown. In the end, if these "if_else" handles are baked into meanjs out of the box would be awesome. |
@jcaspian is this only for Facebook or for the others as well? |
@ilanbiala I'm sorry I have only tested with FacebookStrategy but not the other passport providers but I believe if the other providers have the permission features then this issue may exists in them as well. I have done some research earlier today and I found that we can pass a parameter to Facebook while making Login request to re-request permissions that are previously denied. The parameter is If every Facebook Login request is sent with this parameter |
…l not be mapped. Username will be generated from first initial of first name and last name. .jshint latedef set to nofunc.
I find when I use my facebook account "**[email protected]" login, the terminal log is "/authentication/signin?err=Email%20already%20exists" and stay signin page; |
Facebook API v2 no longer returns username, hence on FacebookStrategy callback we'll get undefined for profile.username.
Currently I'm using the below in
config/strategies/facebook.js
as my workaround.line 32:
username: profile.username || profile.id
Another thing is when user chose not to allow the access of email from Facebook there'll be a small error which causes the app to skip saving/updating the user.
My workaround in
config/strategies/facebook.js
line 31:
email: (profile.emails)? profile.emails[0].value: ''
The text was updated successfully, but these errors were encountered: