Firebase身份验证-过期的api密钥 [英] Firebase authentication - expired api key

查看:299
本文介绍了Firebase身份验证-过期的api密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个无服务器客户端应用程序,该应用程序使用Firebase身份验证和Google的其他服务.突然,当FB登录身份验证停止工作时,一切都很好.碰巧,当尝试登录用户时,我获得了带有以下正文的400 BADREQUEST:

i am developing a serverless client app that uses Firebase authentication and other services from Google. It was all working nicely, when suddely the FB login authentication stopped working. It happens that when try to login the user i obtain a 400 BADREQUEST with the following body:

{
    "error": {
        "code": 400,
        "message": "API key expired. Please renew the API key.",
        "errors": [{
            "message": "API key expired. Please renew the API key.",
            "domain": "global",
            "reason": "badRequest"
        }],
        "status": "INVALID_ARGUMENT"
    }
}

引起问题的网址是:

https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=AIzaSyDXJ1Lwo_Md0xZzFfPX9Y8dQWOaODE4uiM&cb=1534851951010

一些奇怪的事情:

  • 我测试了完全不同的项目(因此使用了全新的密钥):仍然失败
  • 如果我转到云控制台,会发现Google自动创建了几个 unrestricted 键(我附有屏幕截图)
  • i tested with totally different projects (so brand new keys): still failing
  • if i go to cloud console i found several unrestricted keys automatically created by Google (i attach a screenshot)

我还创建了一个全新的应用程序并在本地执行.结果一样.

I also created a brand new app and executed it locally. Same outcome.

有什么想法吗?

添加:我刚刚发现Identity API目前正在有效地向我返回100%的故障.

Add: i have just discovered that the Identity API is effectively returning me 100% failures at the moment.

推荐答案

我也能够解决此问题,这有助于我解决问题:

I was able to get this issue as well and this helped me solve my issue:

  1. 转到Google api控制台并找到密钥:Android密钥(由Google Service自动创建).当您选择以下选项时,Firebase会自动生成这些密钥:身份验证中的电子邮件/密码.复制该密钥.

  1. Go to google api console and find the key: Android key (auto created by Google Service). These keys are automatically generated by Firebase when you choose the option: Email/password in authentication. Copy that key.

转到Android Studio中项目"部分下的google-services.json.单击该文件,然后查找api_key-> current_key.在步骤1中使用api密钥修改该值.

Go to the google-services.json in your android studio under the projects section. Click on the file and look for the api_key -> current_key. Modify that value with the api key in step 1.

这篇关于Firebase身份验证-过期的api密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆