Firebase 3 - Additional Auth Scope Data

The Firebase 3 documentation says that you can capture additional area data such as this:

Optional: specify the additional OAuth 2.0 areas 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');

After authentication, I cannot find the data as part of a "user" object. Any idea how to select additional data?

Thanks,

+5
source share
2 answers

Firebase V3 will not return additional requested data if additional OAuth 2.0 areas are requested. What you need to do is get the returned credentials (signInWithPopup and getRedirectResult), and then use the Google accessToken in response to the google api credentials to request additional data.

0
source

I checked this and used Github as an example, I was able to get the user's email address only if the user's email address was set for the public on github. Passing the user:email did not affect when the email address was configured as private. eg.

 provider = new firebase.auth.GithubAuthProvider(); provider.addScope('user:email'); 
0
source

All Articles