Firebase authentication - expired api key

隐身守侯 提交于 2019-12-07 11:50:53

问题


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"
    }
}

The url causing the problem is:

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

Some weird things:

  • 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.

Any ideas ?

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


回答1:


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

  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.

  2. 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.




回答2:


I Was able to resolve the issue by going into my firebase project settings> General> update my old API key with the Web API key value.




回答3:


I had the same problem, i fixed it by: Resetting my project, which included... Deleting the Google-Services.json file, replacing the SHA1 key, syncing and adding the new Google-Services.json file on my project. hope it helps you.

Cheers



来源:https://stackoverflow.com/questions/51948073/firebase-authentication-expired-api-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!