【问题标题】:firebase auth/unauthorized-domain error although I authorized the domainfirebase auth/unauthorized-domain 错误,虽然我授权了域
【发布时间】:2020-02-05 15:01:24
【问题描述】:

我尝试设置 Firebase 身份验证,并且在 localhost 上它也可以正常工作。但是在我在 Firebase 上获取应用程序后,我收到错误 auth/unauthorized-domain

我已经查看了 Firebase,并且该域已列入白名单。

我使用 Google 登录 Firebase 的代码:

const provider = new auth.GoogleAuthProvider();
    await this.afAuth.auth.signInWithPopup(provider)
    .then ( credential => {
      return this.updateUserData(credential.user);
    })
private updateUserData(user) {
    const userRef: AngularFirestoreDocument<User> = this.afs.doc(`users/${user.uid}`);

    const data = {
      uid: user.uid,
      email: user.email,
      displayName: user.displayName,
      photoURL: user.photoURL
    };

    return userRef.set(data, { merge: true });
  }

这是完整的错误信息:

code: "auth/unauthorized-domain"
message: "This domain (nutrimap-c4d12.web.app) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -

【问题讨论】:

  • 如果您认为您已正确完成所有操作,但未按预期方式工作,请直接联系 Firebase 支持以获取故障排除帮助。 support.google.com/firebase/contact/support
  • 感谢您的提示,我会尝试的。

标签: angular firebase firebase-authentication


【解决方案1】:

您的域 nutrimap-c4d12.web.app 似乎未添加到 Firebase OAuth 重定向域。您需要确保他们的域已经存在于 OAuth 重定向域 中,方法是转到控制台 Auth 选项卡上的 SETUP SIGN IN METHOD

【讨论】:

  • 不,域已经添加到那里。如果您提及,请在授权域下
猜你喜欢
  • 2023-01-19
  • 2021-12-17
  • 2023-02-11
  • 1970-01-01
  • 2018-02-01
  • 2020-06-01
  • 2014-01-06
  • 2012-01-26
  • 1970-01-01
相关资源
最近更新 更多