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 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.
Your API key is outdated. Go to Google API console, create a new public API key there and paste it to the "API Key For Your Firebase Dynamic Links Account" field on the plugin's settings page.
The API key provided by your Connect platform has expired. This occurs if your platform has either generated a new key or the connected account has been disconnected from the platform. Obtain your current API keys from the Dashboard and update your integration, or reach out to the user and reconnect the account.
Firebase ID tokens are short lived and last for an hour; the refresh token can be used to retrieve new ID tokens. Refresh tokens expire only when one of the following occurs: The user is deleted. The user is disabled.
I was able to get this issue as well and this helped me solve my issue:
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.
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.
First, go to https://console.firebase.google.com/
Then choose the Android project
Then go to SETTINGS of that project
First, check that: sha1 and sha256 fingerprint are there for debug apk (Necessary) and release apk (necessary if you create a signed apk)
There you will see a download JSON file button, click on it, and download the file.
Then go to Android Studio and OPEN your project.
Then on the left side menu, click the project subfile then find the googleservices.json file.
Open that file by double-clicking it
Now open the downloaded file, googleservices.json, and open it in notepad.
Now copy all the content, just select all, and copy.
Now go to the Android Studio, and right-click on the Google services file (in IntelliJ) and click compare with the clipboard and carefully accept all the differences into the Android Studio file.
Or you can directly remove all the content and paste the copied into the Android Studio JSON file.
DONE! NOTE: Make sure you make a copy of the file before doing this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With