Where can I get "serviceAccountCredentials.json" for Firebase Admin?

It says here that I need to configure Firebase on java:

FirebaseOptions options = new FirebaseOptions.Builder()
    .setDatabaseUrl("https://databaseName.firebaseio.com")
    .setServiceAccount(new FileInputStream("path/to/serviceAccountCredentials.json"))
    .build();
FirebaseApp.initializeApp(options);

But where can I get serviceAccountCredentials.json ?

UPDATED: I found that this file should have these fields, but where to get these values?

{
  "type": "",
  "project_id": "",
  "private_key_id": "",
  "private_key": "",
  "client_email": "",
  "client_id": "",
  "auth_uri": "",
  "token_uri": "",
  "auth_provider_x509_cert_url": "",
  "client_x509_cert_url": ""
}
+4
source share
1 answer

This is described in detail in this link.

To create a file you need to follow this link

https://console.firebase.google.com/project/**YOUR_PROJECT**/settings/serviceaccounts/adminsdk
+4
source

Source: https://habr.com/ru/post/1661910/


All Articles