简体   繁体   English

Firebase 管理员 SDK 和应用程序检查 SafetyNet

[英]Firebase Admins SDK and App check SafetyNet

I have firebase project connected to android app, and I am using App check (SafetyNet), and it work 100% well.我有 firebase 项目连接到 android 应用程序,我正在使用应用程序检查(SafetyNet),它工作 100% 好。

Also I am using admins SDK (java) to connect and do action in the project.此外,我正在使用管理员 SDK (java) 连接并在项目中执行操作。 before using the App check every thing was working 100% well, but after enabling app check I can't access and all action fail.在使用应用程序检查之前,每件事都 100% 运行良好,但在启用应用程序检查后,我无法访问并且所有操作都失败了。

so how to deal with admin SDK and app check?那么如何处理管理员 SDK 和应用程序检查?

   FirebaseOptions options = new FirebaseOptions.Builder().setCredentials(GoogleCredentials.fromStream(
            new ClassPathResource("/myproject-firebase-adminsdk.json").getInputStream()))
            .setDatabaseUrl("https://myproject-default-rtdb.firebaseio.com").build();

    if (FirebaseApp.getApps().isEmpty()) {
        FirebaseApp.initializeApp(options);
    }

DatabaseReference ref2 = FirebaseDatabase.getInstance().getReference("/users");
     ref2.addListenerForSingleValueEvent(new ValueEventListener() {
        @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
            Object document = dataSnapshot.getValue();
            System.out.println(document);
    }

    @Override
    public void onCancelled(DatabaseError error) {
        System.out.println(error);

    }
});

应用检查

Firebaser here Firebaser 在这里

Apologies for the inconvenience and thank you for reporting this issue -- this is similar to a previously reported issue we've seen on Admin Node.js SDK , and we are working on releasing the fix.对于给您带来的不便,我们深表歉意,并感谢您报告此问题 - 这与我们在管理员 Node.js SDK 上看到的先前报告的问题相似,我们正在努力发布修复程序。 Please follow the GitHub thread for updates.请关注GitHub 线程以获取更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM