5

We are using Firebase Authentication in a multitenant setup. Under certain circumstances, we want to disable all users for one tenant (trial ended, subscription not renewed ...) or enable all previously disabled users. We send an UpdateRequest for every user that has to be enabled/disabled.

Although we send the requests sequentially (only one at a time per tenant and not many tenants are disabled at the same time), we have encountered a quota exceeded error several times:

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "invalid",
                "message": "QUOTA_EXCEEDED : Exceeded quota for updating account information."
            }
        ],
        "code": 400,
        "message": "QUOTA_EXCEEDED : Exceeded quota for updating account information."
    }
}

Is there a way to do a batch update for multiple users using the Admin SDK? We are currently using it from Java, but NodeJS would also work for us. Alternatively, it would be interesting to know, if there is another way to disable multiple users, e.g. with an expression filter on user properties.

Kariem
  • 4,398
  • 3
  • 44
  • 73
  • What exactly are you using firebase authentication for? – André Kool Jun 08 '18 at 15:08
  • @AndréKool to authenticate our users. We are currently using custom tokens and JWT with our internal user database and are looking to migrate all platforms to directly using Firebase Auth. – Kariem Jun 08 '18 at 15:34
  • It looks like [this page](https://firebase.google.com/docs/functions/quotas) in the docs lists all of Firebase's quotas for cloud functions. I assume these would apply even to write/update requests to the auth section of Firebase too. There are two limits that I could see you triggering... either the line: `API calls (INVOKE) Calls to the "call" API 16 per 100 seconds` or maybe even: `API calls (WRITE) Calls to deploy or delete functions via the Cloud Functions API 80 per 100 seconds`... and at the end of that page it describes how to edit those quotas. Have you tried any of this yet? – JeremyW Jun 08 '18 at 16:19
  • Depending on what u use it for it might be a possibility to use [firebase security rules](https://firebase.google.com/docs/database/security/) to enable/disable access to your data. – André Kool Jun 11 '18 at 08:03
  • @JeremyW Thank you for the suggestions. We are not using the cloud functions. The admin SDK is strigger from an environment running on a compute instance. These auth limits (https://firebase.google.com/docs/auth/limits) do not show anything. – Kariem Jun 11 '18 at 13:38
  • @AndréKool Thank you for the suggestion. However, we are not using Firebase Realtime Database nor Cloud Firestore for this project at the moment. – Kariem Jun 11 '18 at 13:40

1 Answers1

3

There are no bulk operations for updating users with the Firebase Admin SDK. Please feel free to file a feature request describing your use case for that.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Follow-up question: there is no enable/disable user in https://firebase.google.com/docs/auth/limits, the error message does not really indicate which API is used here ("Updating account information") and I do not see any limits reached on the quotas page for the project (https://console.cloud.google.com/iam-admin/quotas). Can I request a quota raise somewhere? And which quota should be raised? – Kariem Oct 19 '18 at 08:38
  • Sorry, I don't understand the problem you're running into. Please ask a new question here on SO with the details to help understand the problem. – Doug Stevenson Oct 19 '18 at 16:04
  • Are there any plans to implement bulk operations for users? I'm just finding this out and can't believe that there's both no way to issue a big series of updates sequentially and no way to bulk update. What's the expected solution when one needs to update a variety of Firebase users? – bsplosion Nov 15 '22 at 20:19