Restrict realtime database access to other Firebase projects - firebase

We use our Firebase real-time database as a read-only database for our users using the firebase real-time database rules. We use the same databases for all our applications. These databases reside in the project "database-project". Our apps have individual projects, e.g., project X, project Y, and project Z. This seems to work now because anyone can attach to our real-time databases using a reference string e.g., https://our-realtime-database.firebaseio.com/. Would it be possible to restrict access so that only the projects mobility-inside, project Y, and project Z would be able to access these databases? Or, is there another way to structure our setup so that we have one database that is shared over multiple projects with access somewhat restricted?

Related

How To Create A Central Auth Project In GCP/Firebase?

So what Im trying to do is, create a central project that holds all auth credentials and base user information in Firestore. Then have other projects connect to that project to gain access to individual apps. An example of this would be the following:
Project A - Auth Project
Project B - App 1
Project C - App 2
Project B Authentication -> Project A Authenticate And Give Project B Firestore User Object
Project C Authentication -> Project A Authenticate And Give Project C Firestore User Object
Anyone have any idea how I can do this? I have an idea that I may be able to do it with Firebase functions but can I also do it from the frontend such as from an iOS app? Would that require two Firebase Config files? If so how do I differentiate between the two of them in the iOS app?
A little more context on this. I am finished creating my first app. I am beginning to create an app that is completely different from the first app but I need my users to be able to share credentials across both apps. So my plan is to create a single project that holds the master user record and authenticates users from both of the other projects. Does this make sense? Also users will only authenticate using email/password combo, nothing else.
Any help would be greatly appreciated. Thanks.
You can check these official documentation on how to configure multi projects and understanding the firestore app and projects in detailAs,any Firebase project is governed by the Firestore security rules basically implement the security model which does refuse data or accounts outside of the project where they were deployed.You can try to implement with some backend API which can communicate between the two systems maintaining these security constraints.Also,If you want users from project B and project C to share credentials which have been authenticated in project A and you can let the user authenticate with the same UID with a "parallel" account in the second project rules on B would still be limited to the app and data for the immediate project and would not be able to access anything directly into other one.
I recommend you to check the following examples for the similar approach:
Use Firebase auth data and users for multiple project and apps
Single firebase project for multiple GCP projects
Implementing cross project user authentication

Firebase: how to handle two PWA apps in the same project?

I'm developing a project where I need two PWA apps defined on the same Firebase project, sharing the same database. One of this app is the 'producer' and the other one is the 'consumer' of the data.
So far I developed the 'producer' side and everything is ok - it writes in the database. Now I'm starting with the 'consumer' side.
Defined like now I'm not able to deploy the second one, cause it shares the same hosting so it overwrites the first app.
How can I structure the project to have two PWA apps sharing the same DB but not the same hosting (and URL)?
It sounds like you want to create a second Firebase Hosting site in the project, which you can then deploy to separately.

How to give different IAM permission per realtime database on firebase?

Currently, we have an application in production using firebase. We have a project per environment: develop and production.
I have seen that we can create multiple databases and we can have multiple hosting sites. Which makes it perfect to create multiple environments in the same project.
The issue is that in develop environment we have multiple people(DEVELOPERS) with editor access to the database. In production, we want that only one person have access.
If there a way to restrict permissions per database?
While it is possible to restrict what Firebase features a collaborator can access within a project, the level of granularity you want is not. There is no way to give a collaborator on a project different level of access to different database instances in that project, or to different hosting sites.
The common way to set up the multiple variants is by creating a separate project for each of your develop and production apps.

Xamarin Forms with Azure web app and Azure SQL backend

I am evaluating Xamarin and I am hoping to clarify that I am on the correct path.
We would like to create a Xamarin forms app with offline sync. We are using azure to host the backend database. I have created an Azure web app that uses as Azure SQL database.
I have seen example using easy tables, which seems to create the API’s for you but I cannot find any examples where an Azure SQL database is used.
I have gone to the quick start blade of my azure web app, selected Xamarin.Forms, then chose the backend language of C# and downloaded the project. The project included the TodoItems table as an example. Am I correct in thinking that I need to replace this code with the model of the tables I have in my azure SQL database? And then add the changes back to the web app to expose the tables so that the xamarin forms app can use?
Or am I completely on the wrong track? Should I be using swagger (which I have no experience with) to create the API?
Thanks.
From How to: Define a table controller, you could find that Data Transfer Object (DTO) class that is used to define the table within the SQL database need to inherit from EntityData class. And deriving it from EntityData class is aimed at making it support the system properties. It seems that you have created some tables in your Azure SQL database, if you’d like to expose these existing SQL database tables that does not contain these system properties, please refer to “Using an existing SQL Table” in chapter 3.

How to move ASP.NET 2.0 applications to the cloud

How can we move our existing ASP .Net 2.0 application to the cloud platform ?
What all changes are required in existing application at code level as well as database level ?
Update: I have one ASP.Net 2.0 application with SQL 2008 database. I want to deploy it on the cloud environment with multi-tenancy support.
In that case what changes are required. Currently 'ConnectionString' is configured in web.config file. How to change the code/ database to achieve multitenancy support.
Basically I am looking for steps to move existing ASP.Net application to the cloud platform.
Please suggest resources for the same.
I am not sure what you mean by multitenancy suppport. Multitenancy usually means that you will need to work on your application and segregate the data for different organizations. Not sure what the cloud has to do with this. If you are expecting to just spin different instances for different organizations you will have to do work again with the API of the cloud provider in question. Some of them can manage applications and instances automatically.
Cloud provides scalability and elasticity (automatic scalability) it does not provide mutltitenancy by itself. To achieve maximum scalability you may need to use cloud data store (usually key/value) and let go of relational databases. This may require serious rearchitecturing of the application. Whether you need this scalability and elasticity is another topic and you may just use the cloud as infrastructure (i.e. they will manage the servers for you)

Resources