【发布时间】:2018-04-25 01:07:12
【问题描述】:
我正在(在 Android 上):
com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED:权限缺失或不足
使用这些安全规则:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
我的应用似乎已使用 FirebaseAuth 正确验证,因为 mFirebaseAuth.getCurrentUser().getUid() 返回正确的用户 ID。
是不是我做错了什么?
【问题讨论】:
-
这也发生在我身上。直到昨天一切正常,但从今天开始它一直返回权限错误。我检查了我的安全规则,没有任何问题。奇怪的行为是它有时会起作用,有时在完全相同的代码下不起作用。问题解决了吗?
-
这种情况偶尔会发生在 web 和 react-native(firebase-ios-sdk) 上。问题应该出在 firestore 而不是客户端 sdk 上。
标签: android firebase firebase-authentication google-cloud-firestore