如何限制 Firebase 数据修改? [英] How to restrict Firebase data modification?

查看:18
本文介绍了如何限制 Firebase 数据修改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firebase 提供数据库后端,以便开发人员可以专注于客户端代码.

Firebase provides database back-end so that developers can focus on the client side code.

因此,如果有人使用我的 firebase uri(例如,https://firebaseinstance.firebaseio.com),则在其本地上进行开发.

So if someone takes my firebase uri (for example, https://firebaseinstance.firebaseio.com) then develop on it locally.

那么,他们是否能够在我的 Firebase 实例之外创建另一个应用程序、注册并验证自己以读取我的 Firebase 应用程序的所有数据?

Then, would they be able to create another app off my Firebase instance, signup and authenticate themselves to read all data of my Firebase app?

推荐答案

@Frank van Puffelen,

@Frank van Puffelen,

您提到了网络钓鱼攻击.实际上有一种方法可以确保这一点.

You mentioned the phishing attack. There actually is a way to secure for that.

如果您登录到您的 googleAPIs API 管理器控制台,您可以选择锁定您的应用将接受来自哪个 HTTP 引荐来源网址的请求.

If you login to your googleAPIs API Manager console, you have an option to lock down which HTTP referrer your app will accept request from.

  1. 访问 https://console.developers.google.com/apis
  2. 转到您的 Firebase 项目
  3. 转到凭据
  4. 在 API 密钥下,选择与您的 Firebase 项目关联的浏览器密钥(应该与您用于初始化 Firebase 应用的 API 密钥具有相同的密钥.)
  5. 在接受来自这些 HTTP 引荐来源网址(网站)的请求"下,只需添加您的应用的网址.

这应该只允许列入白名单的域使用您的应用.

This should only allow the whitelisted domain to use your app.

这也在此处的 firebase 启动清单中进行了描述:https://firebase.google.com/support/guides/launch-checklist

This is also described here in the firebase launch-checklist here: https://firebase.google.com/support/guides/launch-checklist

也许 firebase 文档可以使这更明显或默认情况下自动锁定域并要求用户允许访问?

Perhaps the firebase documentation could make this more visible or automatically lock down the domain by default and require users to allow access?

这篇关于如何限制 Firebase 数据修改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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