How to add scopes to Facebook login with Firebase

一笑奈何 提交于 2021-02-19 03:54:59

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/39218093/how-to-add-scopes-to-facebook-login-with-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!