我正在尝试将 firestore 与 c# 结合使用,但唯一允许这样做的库处于预发布状态并且需要通过环境变量进行身份验证。因此,在阅读完文档后,我开始研究 REST API。我的问题是,由于我无法设置打开规则的应用程序,我需要某种形式的身份验证。我想知道我是否可以做这样的事情
https://firestore.googleapis.com/v1beta1/projects/YOUR_PROJECT_ID/databases/(default)/documents/cities/LA?auth=MY_AUTH_KEY
最佳答案
documentation for the Firestore REST API描述了使用 Firebase Auth token 进行身份验证所需执行的操作:
After you obtain either a Firebase ID token or a Google Identity OAuth 2.0 token, pass it to the Cloud Firestore endpoints as an
Authorization
header set toBearer {YOUR_TOKEN}
.
关于c# - Firestore REST 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50686107/