我正在使用 Satellizer 进行 Facebook 登录,除了 Facebook 没有返回所有用户信息外,它效果很好。当我包含在我的范围电子邮件和 public_profile 中时,我只得到一个姓名和 ID,但没有电子邮件。
这是我在客户端的 FB 配置,如您所见,我要求提供电子邮件和 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 }
},
在服务器上,这个:
request.get( { url: graphApiUrl, qs: accessToken, json: true }, function( err, response, profile ) { ....
只为配置文件提供 ID 和名称,如下所示:
profile = Object {name: Denis, id: xxx}
不知道我做错了什么以及为什么我没有收到电子邮件,头像......
谢谢。