firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

App Check 'Missing appcheck token' error when performing RTDB operations

Open lahirumaramba opened this issue 3 years ago • 5 comments

  • Admin SDK should bypass AppCheck token verifications for RTDB operations. This seems to be a regression issue in @firebase/[email protected] and up (which is a transitive dependency of @firebase/database-compat).
  • It appears that the issue was previously fixed in https://github.com/firebase/firebase-js-sdk/pull/5146/files

Can reproduce on [email protected] and up.

└─┬ [email protected]
  └─┬ @firebase/[email protected]
    └── @firebase/[email protected]

Internal issue: b/236414557

lahirumaramba avatar Jun 28 '22 18:06 lahirumaramba

Fix: https://github.com/firebase/firebase-js-sdk/pull/6399

lahirumaramba avatar Jun 28 '22 19:06 lahirumaramba

@lahirumaramba I have followed documented steps to setup recaptcha and use AppCheck with flutter. I've enabled enforcements for cloud Firestore but after enabling enforcements I'm getting the following error.

[cloud_firestore/permission-denied] Missing or insufficient permissions.

Faizan770gp avatar Jun 29 '22 00:06 Faizan770gp

Hi @Faizan770gp are you using the Firebase Admin SDK or Firebase Client SDKs? If you are using Firebase client SDKs and getting the above error, it might be due to how your security rules are set. You can check your existing rules at Go to Database -> Rules : on the Firebase console. In the future please use this repo for Firebase Admin SDK SDK related questions. Thanks!

lahirumaramba avatar Jun 29 '22 17:06 lahirumaramba

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

My database rules are set to true in all conditions. So the rules are not the problem here.

Faizan770gp avatar Jun 29 '22 22:06 Faizan770gp

Hi @Faizan770gp -- thank you for bringing your issue to our attention. The issue you experienced with Flutter and Firestore may be related to a similar issue we recently fixed. Could you please try updating to the latest Flutter App Check version and see if that fixes your issue?

weixifan avatar Jul 27 '22 16:07 weixifan