如何仅允许我的应用程序在没有登录的情况下访问 firebase? [英] How to allow only my app to access firebase without a login?
问题描述
我将我的应用数据存储在 Firebase 上,事实证明这是我在 Firebase 上的第一个项目比我想象的要困难得多.我已经浏览了官方文档,它说我们可以登录用户使用他们的电子邮件和密码或使用其他登录选项,如谷歌或 Facebook 等.但是我不希望用户登录我的应用程序,但只读取和写入数据到 firebase 如果他们使用我的应用程序.现在我正在为我的 firebase 使用公共规则,但是任何引用我的 firebase URL 的人都可以读取和写入数据库.我该如何克服?
I am storing my app's data on Firebase and this being my first project on Firebase is proving to be much more difficult than I thought. I have gone through the official documentation and it says that we can login a user with their email and password or use other login options like Google or Facebook etc. However I don't want user's to login to my application but only read and write data to firebase if they are using my app. Right now I am using public rules for my firebase but then anyone with a reference to my firebase URL can read and write to the database. How do I overcome this?
提前致谢.
推荐答案
在 Firebase 控制台中 Authentication 选项卡下的 Sing-in Method 下启用 Anonymous sing-in provider 和使用 firebase 匿名身份验证
Enable Anonymous sing-in provider under Sing-in Method under Authentication tab in your Firebase Console and use firebase anonymous authentication
这篇关于如何仅允许我的应用程序在没有登录的情况下访问 firebase?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!