Hi!
According to the FAQs, only a very small number of apps may be connected to a single Firebase project, seemingly due to a (arbitrary?) limit of 30 OAuth2 IDs per Firebase project.
I am developing a point of sale app for restaurants. The app has the special feature that it gives each restaurant client the option of having their "own" white label consumer mobile app that is connected to a single Firestore instance that stores all customer, consumer, sales and menu data for all restaurants.
Now, until I realized that I cannot have a large number of mobile apps connected to a Firebase project, using Firebase seemed to be a great solution. However, realizing the project app limit is tiny, I can only think of one other way to structure my system on Firebase using multiple projects:
ONE BASE PROJECT
This single Firebase project hosts my Firestore instance, my cloud functions and ideally the table of all authenticated users.
MANY WHITE LABEL CONSUMER APP PROJECTS
This type of project is connected to a single restaurant's white label consumer app. There could be 100s of these white label projects if my business idea is successful, all using data from the BASE PROJECT.
Each white label app project is connected to one Android and one iOS app written in Flutter. As far I understand
https://firebase.google.com/docs/projects/multiprojects, it is easy to access the BASE PROJECT Firestore and Cloud Functions from each white label app by instantiating a "secondary" Firebase application object.
However, what is unclear (to me) from the Firebase docs is how user authentication is handled and security rules are handled with regards to the secondary Firebase application object.
- Can I use my base project's sign in methods to authenticate users of the WHITE LABEL apps? Can I have a single user base for all my white label apps and the base project by handling user sign-in through the secondary Firebase application object (connected to the BASE PROJECT) or does this require adding each white label app to the base project and thereby running into the tiny 30 OAuth2 ID limit again?
- If I must handle user auth in each white label project separately, will each user still receive a globally unique user ID, i.e. one that is unique across all my Firebase projects? Also, will requests to the BASE PROJECT Firestore and Cloud Functions from WHITE LABEL app user still be populated with a correct request.auth.uid, so that I can manage access rules, as if the users who make calls to BASE PROJECT's Cloud Functions and Firestore from WHITE LABEL apps were actually BASE PROJECT users?
My questions follow after reading the docs for AWS AppSync and Cognito. AWS seems to provide far clearer docs and also their user handling seems more advanced than Firebase's. It appears in AWS I can connect 1000s of mobile apps to a single AppSync'ed DynamoDB database using a single user pool for all apps. This would obviously be the best solution for me, but unfortunately I already invested a lot of work in Firebase, so first I will try to make my app work on Firebase. However, please help me answering the above questions so I don't need to waste time trying to do things on Firebase that cannot be done.
Best,
Arne