简体   繁体   中英

Firebase Auth/unauthorized domain. Domain is not authorized

I am trying to run this sample firebase project, but I keep getting this error in the browser console.

Lf {code: "auth/unauthorized-domain", message: "This domain (mail-demo-fcm.firebaseapp.com) is not…se console -> Auth section -> Sign in method tab."}

code: "auth/unauthorized-domain"

message: "This domain (mail-demo-fcm.firebaseapp.com) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab."

I have enabled Google in Authentication -> Sign-in Method as sign-in providers.

在此处输入图像描述

Am I missing something?

A little guide will be helpful.

And I am using Firebase's free plan.

You need to add domain mail-demo-fcm.firebaseapp.com to Authentication menu in Firebase at Authorized domains在此处输入图像描述

Below the sign-in method section, there is a Authorized domains section. I think you need to whitelist your domain there.

@alkas 的解决方案很有帮助,但我还需要为我的应用程序(电子邮件/密码、谷歌等)明确启用登录提供程序,以消除此错误

Enable localhost and your own domain that you are using in the firebase console.

  1. Login into firebase
  2. Click on the authentication tab
  3. Add authorized domains

In my case, I found the problem after deleting localhost from my "Authorized domains".

So I just add it (localhost), so everything is okay !

-localhost, because I'm on local,

-project_name.firebase.com and project_name.web.app when app deployed. Thanks !

The authorized domains section might also be in the settings page. Here is a screenshot: firebase 授权域的屏幕截图

  1. Open Firebase
  2. Go to console
  3. Open your project
  4. Go to Authentication
  5. sign-in-method
  6. Add domain

Try it!

In my case it's working

If localhost is already in the list of domains, make sure you're accessing your test app via http://localhost/ and not http://127.0.0.1/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM