如何使用Firebase将范围添加到Facebook登录 [英] How to add scopes to Facebook login with Firebase

查看:73
本文介绍了如何使用Firebase将范围添加到Facebook登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试添加范围并从Facebook访问已登录用户的更多属性.但是,Firebase 3 SDK似乎尚不清楚.

I am trying to add scope and access more properties of the signed in user from Facebook. However, Firebase 3 sdk seems to not be clear on that.

provider = new firebase.auth.FacebookAuthProvider();
provider.addScope('public_profile, email, gender, user_birthday');
firebase.auth().signInWithPopup(provider).then((result) => {
      var token = result.credential.accessToken;
      var user = result.user; // doesn't have any extra information
});

有人知道如何访问其他范围吗?

Has anyone figured out how to access additional scope?

推荐答案

当前无法通过firebase用户获得其他范围数据.您需要从result.credential.accessToken获取返回的访问令牌,然后调用facebook api以获取该其他数据.

The additional scope data are currently not available via firebase user. You will need to get the returned access token from result.credential.accessToken and then call the facebook api to get that additional data.

这篇关于如何使用Firebase将范围添加到Facebook登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆