【问题标题】:Flutter Web App cannot access the Firebase Cloud FirestoreFlutter Web App 无法访问 Firebase Cloud Firestore
【发布时间】:2022-01-16 03:58:01
【问题描述】:

由于我处于开发模式,我的 Firebase 安全规则是:

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

但是除了公开规则之外,我还面临这个错误。

Error: [cloud_firestore/permission-denied] Missing or insufficient permissions.
    at Object.throw_ [as throw] (http://localhost:7357/dart_sdk.js:5061:11)
    at http://localhost:7357/packages/firebase_core/src/internals.dart.lib.js:81:63
    at _RootZone.runUnary (http://localhost:7357/dart_sdk.js:38511:59)
    at _FutureListener.catchError.handleError
    (http://localhost:7357/dart_sdk.js:33726:33)
    at handleError (http://localhost:7357/dart_sdk.js:34281:51)
    at Function._propagateToListeners (http://localhost:7357/dart_sdk.js:34307:17)
    at _Future.new.[_completeError] (http://localhost:7357/dart_sdk.js:34157:23)
    at async._AsyncCallbackEntry.new.callback
    (http://localhost:7357/dart_sdk.js:34193:31)
    at Object._microtaskLoop (http://localhost:7357/dart_sdk.js:38778:13)
    at _startMicrotaskLoop (http://localhost:7357/dart_sdk.js:38784:13)
    at http://localhost:7357/dart_sdk.js:34519:9

卡住了。请帮忙! 注意:我也试过 allow read, write: if true;

【问题讨论】:

  • 试试这个(不带分号):allow read, write: if true
  • 它没有帮助。我也试过了,但没有白费……
  • 也许您启用了应用检查?
  • @PeterKoltai 是的。这就是问题所在。您可以将此作为答案发布。
  • 很高兴听到,我刚刚遇到了与 App Check 类似的问题,这就是为什么我想到它可能是一个原因。

标签: firebase flutter google-cloud-firestore firebase-app-check


【解决方案1】:

正如@Peter Koltai 所说,启用应用检查是这里的问题。 最近添加了对 Firestore 的 App Check 支持,更多详情check here

【讨论】:

    猜你喜欢
    • 2020-04-26
    • 2020-02-01
    • 2021-08-23
    • 1970-01-01
    • 1970-01-01
    • 2021-08-13
    • 1970-01-01
    • 2021-01-26
    • 2020-10-17
    相关资源
    最近更新 更多