【发布时间】:2022-11-21 05:37:59
【问题描述】:
我为我的 Firebase 应用程序创建了一个自定义 Firebase App Check 提供程序。我的问题是,在从我的自定义应用程序检查中获取令牌后,如何使用 Firestore REST API 正确发送成功的请求。谢谢!
【问题讨论】:
标签: firebase google-cloud-firestore firebase-app-check
我为我的 Firebase 应用程序创建了一个自定义 Firebase App Check 提供程序。我的问题是,在从我的自定义应用程序检查中获取令牌后,如何使用 Firestore REST API 正确发送成功的请求。谢谢!
【问题讨论】:
标签: firebase google-cloud-firestore firebase-app-check
您需要像这样在请求的标头中设置 appCheck 令牌
// Include the App Check token with requests to your server.
const apiResponse = await fetch('https://yourFirebaseRestApiURL/Endpoint', {
headers: {
'X-Firebase-AppCheck': appCheckTokenResponse.token,
}
});
这在 Firestore Rest API 中没有记录,但在 AppCheck 文档中 https://firebase.google.com/docs/app-check/web/custom-resource
【讨论】: