Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add scopes to Facebook login with Firebase

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?

like image 693
Rajat Avatar asked Nov 24 '25 18:11

Rajat


1 Answers

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.

like image 163
bojeil Avatar answered Nov 27 '25 08:11

bojeil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!