【问题标题】:Recommend resolution for the error: OPERATION_NOT_ALLOWED : The identity provider configuration is disabled错误的建议解决方案: OPERATION_NOT_ALLOWED : 身份提供者配置已禁用
【发布时间】:2019-09-23 23:06:06
【问题描述】:

有人可以为我在尝试使用 google oath 的 firebase Web 应用程序中遇到的问题推荐解决方案。

这里是sn-p的代码:

//login with google

    const googleButton = document.querySelector('#googleLogin');
    googleButton.addEventListener('click', (e)=>{
        e.preventDefault();
        M.Modal.getInstance(modal).close();
        loginForm.reset();

        const provider = new firebase.auth.GoogleAuthProvider();
        auth.signInWithPopup(provider).then(function(result){
            console.log(result);
            console.log("Successful Google Sign in");


        }).catch(function(error){
            console.log(error);
            console.log("Login failed");

这是我从浏览器获得的响应负载:

{
  "error": {
    "code": 400,
    "message": "OPERATION_NOT_ALLOWED : The identity provider configuration is disabled.",
    "errors": [
      {
        "message": "OPERATION_NOT_ALLOWED : The identity provider configuration is disabled.",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

我得到的不是控制台日志中的Successful Google Sign in,而是:

自动为“http://127.0.0.1:5500”上的跟踪器“https://nompu-website.firebaseapp.com”授予存储访问权限。

我已启用 Google 作为登录选项之一。

【问题讨论】:

  • 您确定从 Firebase 控制台启用了登录方法吗?

标签: javascript firebase google-api


【解决方案1】:

我重新启动浏览器,重新运行 web-application ,从 Firebase 控制台启用 Google 登录方法(再次),最后将自定义类型的授权域 (127.0.0.0) 添加到授权域列表中。它奏效了。

【讨论】:

    猜你喜欢
    • 2022-01-08
    • 1970-01-01
    • 1970-01-01
    • 2011-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多