首页 > 解决方案 > 无法在flutter中使用firebase auth使用电子邮件和密码登录或注册

问题描述

我正在使用带有电子邮件和密码的颤振 firebase 身份验证。当我登录或注册时,我收到以下错误:

发生内部错误。[ 对此 API 身份工具包方法 google.cloud.identitytoolkit.v1.AuthenticationService.SignInWithPassword 的请求被阻止。]

我正在使用 firebase_auth:^0.8.4+2。我已经从我的 firebase 控制台启用了使用电子邮件和密码进行注册。

标签: flutter

解决方案


在我的情况下,Angular 环境文件中的 apiKey 只允许使用我限制的几个 Google Cloud API。

我去了https://console.cloud.google.com,选择了项目

(same as the Firebase project of course)

然后是 API & Services > Credentials。在 API 密钥列表中,我查找了 Firebase 项目概述中给出的相同 API 密钥,单击它,然后进入选项卡 API 限制。通过选择框,我将 Identity Toolkit API 添加到允许的 API 列表中。

或使其不限制密钥

在此处输入图像描述


推荐阅读