【问题标题】:User Authentication failed in angularFire2angularFire2中的用户身份验证失败
【发布时间】:2018-11-04 12:52:31
【问题描述】:
//Login component.ts
import { Component } from '@angular/core';
import {AngularFireAuth} from 'angularfire2/auth';
import * as firebase from 'firebase/app';
import {Router} from '@angular/router';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent  {

  constructor(public afAuth: AngularFireAuth , public router: Router) { }
  login() {
    this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider()).then((sucess) => {
      this.router.navigate(['/option']);
  });
}

angularFire2 版本--5.0.0-rc.10 firebase 版本 --4.13.1

我已经在我的 app.module.ts 中导入了 AngularFireAuthModule 和 AngularFireModule 并在 firebase 控制台中启用了 google 身份验证,但我仍然收到错误消息 -this is the error message i get 请帮忙!!

【问题讨论】:

  • 您是否在身份验证设置中启用了谷歌登录?
  • 是的,我已经启用它
  • 看到这个不能发表评论..最好在 stackblitz 中分享

标签: firebase firebase-authentication angularfire2 angularfire5


【解决方案1】:

您是否为 FireBase 提供了正确的配置?使用您所有的身份验证域和 api 密钥?

参见第 4 步:AngularFire2 installation Guide

请不要忘记不要在此处发布配置,或者更改您的值,因为它包含密钥。

【讨论】:

  • 是的,我确实为 firebase 提供了正确的配置以及身份验证域和 api 密钥
  • 您是否正在使用具有提交行为的按钮?如果是这样,您可以尝试删除提交,或者如果您在表单中使用它,请删除表单标签 swell
猜你喜欢
  • 2017-07-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-12-01
  • 1970-01-01
  • 2014-01-24
相关资源
最近更新 更多