【问题标题】:Error creating account with Firebase admin使用 Firebase 管理员创建帐户时出错
【发布时间】:2018-02-03 08:53:52
【问题描述】:

我正在尝试使用 Firebase 函数和 Firebase 管理员为用户创建一个帐户。尝试创建帐户时出现以下错误:

Access Not Configured. Google Identity Toolkit API has not been used in project 252096998845 before or it is disabled. Enable it by visiting https://...

问题是,如果与我当前的项目编号不同,它在错误消息中给我的项目编号。不知何故,它有错误的项目?我的所有其他功能都运行良好,在我当前的项目中没有问题。

我访问过它给我的网址,但该项目显然不存在

这个项目是从“旧”Firebase 迁移而来的,如果这很重要的话。

编辑: 已启用相应的登录方法。 我正在使用 NodeJS 管理 SDK。 我已经尝试在 Google 控制台中选择我的项目并查找 Identity Toolkit API,但它已经启用。

完全错误:

An internal error has occurred. Raw server response: "{"error":{"errors":[{"domain":"usageLimits","reason":"accessNotConfigured","message":"Access Not Configured. Google Identity Toolkit API has not been used in project 252096998845 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project=252096998845 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","extendedHelp":"https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project=252096998845"}],"code":403,"message":"Access Not Configured. Google Identity Toolkit API has not been used in project 252096998845 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project=252096998845 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."}}"

【问题讨论】:

    标签: firebase firebase-authentication firebase-admin


    【解决方案1】:

    我正在使用admin.inializeApp(functions.config().firebase) 初始化我的应用程序。使用

    初始化应用程序
    admin.initializeApp({
      credential: admin.credential.cert(serviceAccount),
      databaseURL: 'https://XYZ.firebaseio.com/',
      storageBucket: 'gs://project-XYZ.appspot.com/'
    });
    

    方法修复它。

    【讨论】:

      【解决方案2】:

      转到您的 Firebase 帐户并找到此

      authentication -> sign-in method

      它将显示许多登录方法,如 facebook、phone、google 等 .. 启用谷歌登录方法,然后重试。

      【讨论】:

      • Ofc,见上文 :)
      • 转到 google api 并选择您的项目并启用 Identity Toolkit API
      • 这样做了吗,API 已经启用:/ 但问题似乎是它有错误的项目
      • 哪个库用于身份验证?
      • NodeJS SDK。不过应该没关系
      最近更新 更多