In the Firebase 3 documentation, they say you can grab additional scope data such as this one:
Optional: Specify additional OAuth 2.0 scopes that you want to request from the authentication provider. To add a scope, call addScope. For example:
provider.addScope('https://www.googleapis.com/auth/plus.login');
Once authenicated, I can't find the data as part of the "user" object. Any idea how to pick that extra data ?
Thank you,
Firebase V3 will not return the additional requested data when additional OAuth 2.0 scopes are requested. What you need to do is retrieve the credential returned (signInWithPopup and getRedirectResult provide that) and then using the Google accessToken in the credential call the google api to request the additional data.
I have tested this out and using Github as an example, was able to retrieve the user's email address only if the user's email address was set to public on github. Passing the user:email
scope had not effect when the email address was set to private. e.g.
provider = new firebase.auth.GithubAuthProvider();
provider.addScope('user:email');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With