MehdiS
MehdiS

Reputation: 89

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.

Also I am using admins SDK (java) to connect and do action in the project. before using the App check every thing was working 100% well, but after enabling app check I can't access and all action fail.

so how to deal with admin SDK and app check ?

   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);

    }
});

App check

Upvotes: 1

Views: 301

Answers (1)

Lahiru Maramba
Lahiru Maramba

Reputation: 196

Firebaser here

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. Please follow the GitHub thread for updates.

Upvotes: 1

Related Questions