Satellizer Facebook login not returning correct volume
I am using Satellizer to login to Facebook, it works great except Facebook does not return all user information. I only get the name and ID, but not the email address when I use email and public_profile.
Here is my client side FB config, and as you can see, I am asking for an email and public_profile:
facebook: {
clientId: 'xxxxxxx',
url: '/api/public/authentication/facebook',
authorizationEndpoint: 'https://www.facebook.com/v2.3/dialog/oauth',
redirectUri: window.location.protocol + '//' + window.location.host + '/', // window.location.origin || window.location.protocol + '//' + window.location.host + '/'
scope: 'email,public_profile',
scopeDelimiter: ',',
requiredUrlParams: ['display', 'scope'],
display: 'popup',
type: '2.0',
popupOptions: { width: 481, height: 269 }
},
On the server it is:
request.get( { url: graphApiUrl, qs: accessToken, json: true }, function( err, response, profile ) { ....
Shows only the name and name of the profile:
profile = Object {name: Denis, id: xxx}
Don't know what I am doing wrong and why I am not receiving email, avatar ...
Thank.
source to share
From Facebook API v2.4, we need to explicitly specify the fields (ex: email) to receive.
Introducing the Graphics API v2.4
So you should have fields as url parameter like
" https://graph.facebook.com/me?fields=id,email,gender,link,locale,name,timezone,updated_time,verified "
source to share
As the author of the satellite explains,
https://github.com/sahat/satellizer/issues/116
The scope property format must be an array of strings. So yours should be:
Scope: ['email', 'public_profile']
Hope it helps!
Joel
source to share