Firebase Admin Java SDK not doing any operation

我的未来我决定 提交于 2019-12-06 09:23:39

If you are authenticating the SDK with a service account key JSON file as documented in Add Firebase to your app, you should use the fromCertificate() method, not the fromRefreshToken() method:

FileInputStream serviceAccount = new FileInputStream("path/to/serviceAccountKey.json");

FirebaseOptions options = new FirebaseOptions.Builder()
  .setCredential(FirebaseCredentials.fromCertificate(serviceAccount))
  .setDatabaseUrl("https://<DATABASE_NAME>.firebaseio.com/")
  .build();

FirebaseApp.initializeApp(options);

Authenticating with a refresh token is a bit of an advanced use case and is probably not what you want to be using.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!