Firebase 3 - Additional Auth Scope Data

南楼画角 提交于 2019-12-05 10:52:51

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