Friday, 16 April 2021

Interacting with the Firebase Firestore from a separate Python script without Admin privileges

I would like to interface with the Firestore from Python in order to fetch some data in a simple script that exists outside of the main application I'm developing. Then I would like to be able to distribute that script to other employees without needing to provide them with a service account that has unlimited access to the database (because it would be a major security risk). I hope that they could authenticate by providing a username and password to the script either through env. variables or on runtime.

Is there any way to authenticate into Firestore from outside of the client application in another way than through an almighty service account?

I was thinking to just login as a regular user (somehow use the auth API just like a client does) but I couldn't find any documentation or example of that and it seems like I'd be reinventing the wheel writing a wrapper around the firebase API that could authenticate a user and fetch a collection. The same goes for writing my own endpoints for the Python script to use - seems like a huge overkill for such a simple scenario (defeats the purpose of a backend as a service).



from Interacting with the Firebase Firestore from a separate Python script without Admin privileges

No comments:

Post a Comment