来自特定Web URL的Firebase安全规则存储 [英] Firebase Security Rules Storage from specific web url

查看:40
本文介绍了来自特定Web URL的Firebase安全规则存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将存储的安全性规则设置为只能存储从我的Web发送的数据(特定的Web URL).否则,任何人都无法读写.

I want to set the security rules of the storage to be that only data that send from my web (specific web url) can be stored. Otherwise no one can write and read.

这是我的代码:

service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
  allow read, write: if true;
  }
 }
}

但是,这允许任何人存储数据.如何将其限制为我的网址?

but this allows any one to store data. How can I restrict this to my url?

推荐答案

除了Frank的回复.您可以对匿名用户使用Firebase身份验证,因此您可以创建一个当用户访问您的网站并使用它保护存储空间时,透明地显示该信息.

In addition to Frank's reply. You can use Firebase authentication with anonymous user, so you can create one transparently when a user access your web site and secure the storage with it.

这篇关于来自特定Web URL的Firebase安全规则存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆