Get Facebook/Google access token on Firebase Auth#onAuthStateChanged?

萝らか妹 提交于 2019-12-11 10:38:48

问题


If I authenticate using Auth#signInWithPopup I get a result having credentials.

How can I get the same credentials inside the observer for Auth#onStateChanged?


回答1:


You can't get the credentials from Auth#onStateChanged. You can only get them from the result of Auth#signInWithPopup or Auth#getRedirectResult. As these fields are only obtained once on sign-in and not maintained or stored by Firebase Auth (eg. OAuth credential, additional IdP data), they are only returned on sign-in completion.



来源:https://stackoverflow.com/questions/44433444/get-facebook-google-access-token-on-firebase-authonauthstatechanged

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