我在哪里可以获得 Firebase Admin 的“serviceAccountCredentials.json”?
2022-08-31 17:14:17
下面说了我在java上设置Firebase需要什么:
FirebaseOptions options = new FirebaseOptions.Builder()
.setDatabaseUrl("https://databaseName.firebaseio.com")
.setServiceAccount(new FileInputStream("path/to/serviceAccountCredentials.json"))
.build();
FirebaseApp.initializeApp(options);
但是我在哪里可以获得serviceAccountCredentials.json?
更新:我发现这个文件似乎应该有这个字段,但是从哪里得到这个值?
{
"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": ""
}