Cole
Cole

Reputation: 116

Creating a desktop Python app with Firebase, how do I include the private key?

I'm trying to build a desktop application that is built with python and pyqt5. I want to send it to users with their own login details, but I am not totally sure what to do with the private key. Up until now, I've had to do

export GOOGLE_APPLICATION_CREDENTIALS=[path to private key json]

or for windows

set GOOGLE_APPLICATION_CREDENTIALS=[path to private key json]

Obviously I don't want to give out the private key. Is it ok to store it in the program, or is there a special safe way to do that? I'm using pyinstaller to package everything.

Upvotes: 0

Views: 519

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598765

The only SDK Firebase provides for use wit Python is a so-called Admin SDK. As the documentation on [setting up the Admin SDK] says:

The Admin SDK lets you interact with Firebase from privileged environments

So this SDK is not suitable for developing applications for your regular users, as the credentials it requires grant the user full administrative access to your Firebase project.

There is no official Firebase SDK for developing Python applications for regular clients, so your options are limited to:

  • Using the REST APIs for the various Firebase services, and writing your own client-side Python code against that.
  • Using a third-party API, such as Pyrebase that supports both client-side and administrative access.

Upvotes: 1

Related Questions