【发布时间】:2019-01-26 14:12:32
【问题描述】:
正如 Firestore 文档 here 中所写,我有这样的安全规则:
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, update, delete: if request.auth.uid == userId;
allow create: if request.auth.uid != null;
}
}
}
当我通过客户端库进行身份验证时,此规则有效,但当我使用 firebase 文档中所写的服务器库时无效
注意:服务器客户端库绕过所有 Cloud Firestore 安全规则,而是通过 Google 应用程序默认凭据进行身份验证。如果您使用服务器客户端库或 REST 或 RPC API,请确保为 Cloud Firestore 设置 Cloud Identity and Access Management。
如何将此安全规则复制到服务帐户角色?
【问题讨论】:
标签: firebase google-cloud-firestore