Facebook OAuth登录未返回电子邮件 [英] Facebook oauth login not returning email
本文介绍了Facebook OAuth登录未返回电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用此插件进行oauth登录,这是我在进行全面登录时的FB响应:
I am using this plugin for oauth login, here is my FB response while doing aouth login:
{"state":"","access_token":"XYZ","expires_in":5110943,"client_id":"CLIENT ID","network":"facebook","display":"popup","redirect_uri":"http://localhost/XYZ123/www/callback.html","scope":"email,basic","expires":1439628780.389}}
问题是我没有收到用户的 email
.按照其他SO解决方案:
The problem is i am not getting email
of user. As per other SO solutions :
我已经验证了电子邮件,因此这无关紧要.我没有收到FB邮件重新验证邮件的信息.
I have verified email so that should not be a matter. I am not getting FB message regrading verifying email.
此处是客户ID/权限
{
"data": [
{
"permission": "email",
"status": "granted"
},
{
"permission": "public_profile",
"status": "granted"
}
]
}
推荐答案
您需要进行API调用以获取用户个人资料.电子邮件不包含在authResponse对象中.
You need to make an API call to get the users profile. Email is not included in the authResponse object.
var fb = hello('facebook');
fb.login({scope:'email'}).then(function(){
return fb.api('me');
}).then(function(res){
// do something with res.email
}, console.error.bind(console) );
这篇关于Facebook OAuth登录未返回电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文