我有一个用Google帐户进行身份验证的Firebase数据库。目前,我有一个<google-signin-aware>元素,它详细说明了应用程序的登录细节--与Google登录API一起使用,以及在登录时使用Google登录返回的访问令牌对Firebase引用进行身份验证。
在成功登录时,从<google-signin-aware>元素的回调:
var ref = new Firebase("https://<myapp>.firebaseio.com");
var access_token = gapi.auth2.getAuthInst
我成功地使用Firebase的angular库对Facebook和Google的用户进行了身份验证,但在使用Firebase auth的$authWithOAuthPopup时,检索用户的电子邮件却很麻烦。
这是我的登录函数。
var ref = new Firebase(FIREBASE_URL);
var auth = $firebaseAuth(ref);
loginGoogle: function () {
console.log('Logging in Google.');
return auth.$authWithOAuthPopup(&
我正在使用Ionic with Capacitor开发一个iOS和安卓应用程序。我正在尝试使用Google的Firebase进行社交登录。我遵循了一个教程,并将Google登录添加到我的应用程序中,它确实可以工作,但用户(签名后)不会出现在Firebase控制台的“身份验证”部分。我使用的是codetrix-studio/capacitor-google-auth",这是我登录用户的方式: async googleSignIn() {
let googleUser = await Plugins.GoogleAuth.signIn();
let user: User = {
我已经在我的安卓应用程序中实现了google登录,并通过遵循实现了firebase身份验证。然而,我仍然试图理解代码及其背后的逻辑。
因此,在用户成功地与他的gmail帐户登录后,将使用作为参数传递的帐户信息调用方法firebaseAuthWithGoogle:
firebaseAuthWithGoogle(account);
它的定义如下:
private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
// We will put the data coming from the google account