0

Before this, i had tried to get firebase data, and that's work when i initialized firebase app using angular typescript.

But for now, i need to get firebase data automatically by schedule, and i tried to create window service using c#, Also working when i follow this tutorial that i found https://www.c-sharpcorner.com/article/create-windows-services-in-c-sharp/

The problem is, I not found any tutorial how to initialize firebase app using c#, all tutorial is using service account to get firebase data.

But how can i initialize firebase app without service account using c#? because i only get this firebase config as below from firebase owner.

const firebaseConfig = {
  apiKey: "apkey",
  authDomain: authdomain",
  databaseURL: "databaseurl",
  projectId: "projectid",
  storageBucket: "storragebucket",
  messagingSenderId: "messagesenderid",
  appId: "appid",
  measurementId: "measurementid"
};

i had try to find the solution, but not found anything, or is there a way to create a window service from angular typescript?

I would be glad for any help.

Hansen
  • 650
  • 1
  • 11
  • 32

1 Answers1

0

If you are writing backend or desktop code to access Firebase products, you will not be able to use the configuration objects provided for web or mobile applications. You must use a service account to initialize any SDK you're using. The web and mobile SDKs are built for use by end users that require authetnication, but backend code is not driven by end users. The service account effectively authenticates and authorizes backend code to access Firebase products.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441