'Calling a Firebase Cloud Function in production project from beta project

We are building an internal web application that is deployed in our staging Firebase project. We use Firebase Auth to allow our internal team to authenticate using their google account. Everything works fine here, no issues.

But now, we have a requirement to make certain changes to the Firestore DB in our production Firebase project, using the web application deployed in staging. And we only want 'admin' users from our team to be able to do that. I believe we are going to need a Firebase function in production to first authenticate the user as 'admin' and only then allow these read/write operations in its Firestore db. However, the 'admin' user belongs to the staging project.

How do we enable this cross-project authentication and data access in the most secure way possible?

Any ideas/suggestions?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source