【发布时间】:2022-08-17 08:58:01
【问题描述】:
我在我的 vuejs 应用程序中使用 REST API 来访问 firebase 实时数据库,我使用 Google 提供程序对用户进行身份验证并获取访问令牌。 当我尝试使用 access_token https://rtdb-url/uid/products.json?access_token=[access token] 获取数据时,用户得到 401 错误。 但是,如果用户被添加到项目设置中的“用户和权限”中,它就可以工作。
应用于 RTDB 的规则
{
\"rules\": {
\"$uid\": {
\"products\": {
\".write\": \"auth != null && $uid === auth.uid\",
\".read\": \"auth != null && $uid === auth.uid\"
}
}
-
嘿在这里添加你的数据库截图或 json l
标签: firebase firebase-realtime-database firebase-authentication