firebasegoogle-cloud-platformfirebase-authentication

Firebase throws "TOO_MANY_ATTEMPTS_TRY_LATER" for requests from backend server


We are using firebase for implementing the guest user flow in our application. For this, we are logging in such users anonymously by calling the accounts:signUp?key=[API_KEY] API in firebase. Further, we are calling this API from the backend server to avoid exposing our API key on the client (UI and mobile). Now, this works fine in normal testing scenarios, but while performance testing after a while, firebase starts blocking these calls with the following error -

{
  "error": {
    "code": 400,
    "message": "TOO_MANY_ATTEMPTS_TRY_LATER",
    "errors": [
      {
        "message": "TOO_MANY_ATTEMPTS_TRY_LATER",
        "domain": "global",
        "reason": "invalid"
      }
    ]
  }
}

When I searched for this error code, it seems it's expected for the email verification link API, why our sign in call getting this error code? This is a very valid use case where we can login users by calling firebase REST APIs from the backend service, is there anything missing in terms of firebase documentation?


Solution

  • After much searching around, I found that the anonymous login API uses some kind of a sign up method on firebase backend. At the same time, I saw a limit in firebase authentication settings, attaching the screenshot here

    enter image description here

    It was 100 by default and hence my load test failed after 100 anonymous logins, now I have increased it to 1000 user logins in one hour.