问题
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