Herer是我的Google部分
var provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().languageCode = 'zh-TW';
provider.addScope('profile');
provider.addScope('https://www.googleapis.com/auth/userinfo.profile');
provider.addScope('https://www.googleapis.com/auth/userinfo.email');
provider.addScope('https://www.googleapis.com/auth/plus.login');
provider.addScope('https://www.googleapis.com/auth/plus.me');
provider.addScope('https://www.googleapis.com/auth/user.birthday.read');
provider.addScope('email');
firebase.auth().signInWithPopup(provider).then(function(result) {
console.log(result.user)
}).catch(function(error) {
app.message.register = error.message;
});
Herer是我的Facebook部分
var provider = new firebase.auth.FacebookAuthProvider();
provider.addScope('user_birthday');
firebase.auth().languageCode = 'zh-TW';
firebase.auth().signInWithPopup(provider).then(function(result) {
console.log(result.user)
}).catch(function(error) {
});
那两个部分在没有性别和生日的console.log(result.user)
地方缺少一些设置吗?或有错误的部分?任何的想法?
返回的访问令牌result.credential.accessToken
将提供对这些其他范围的访问。您将需要使用该访问令牌查询Google / Facebook API以获取此数据(特定于其他请求的范围)。顺便说一下,现在返回一些特定于IdP的其他用户信息。检查的内容result.additionalUserInfo.profile
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句