简体   繁体   English

不使用身份验证时的Firebase安全性

[英]Firebase security when not using Authentication

I am building apps using Firebase (Storage, Functions, Hosting, Real-Time Database and Firestore). 我正在使用Firebase(存储,功能,托管,实时数据库和Firestore)构建应用程序。 In the apps, the user authenticates using a third-party library (like Google connect but not Google). 在应用程序中,用户使用第三方库(例如Google Connect,但不使用Google)进行身份验证。

I don't know how to protect my database because I am not using Firebase Authentication. 我不知道如何保护数据库,因为我没有使用Firebase身份验证。 How can I use this third party authentication to protect data for example? 例如,如何使用此第三方身份验证来保护数据? Maybe I need to create a user manually and attach information to him so that this info will be available in the Security Rules editor? 也许我需要手动创建用户并将信息附加到他,以便该信息在“安全规则”编辑器中可用?

Thanks 谢谢

I don't think you can secure your database or storage without a form of authentication. 我认为没有身份验证形式就无法保护数据库或存储。

Now firebase provides multiple methods of authentication (email , google, custom , anonymous .....). 现在,firebase提供了多种身份验证方法(电子邮件,谷歌,自定义,匿名.....)。

What you might want: 您可能想要什么:

You might want to add custom login to your users in which they get registered with extra data that you provide. 您可能想要向用户添加自定义登录,以便在用户中注册了您提供的额外数据。 And they will still get a user id that you will use to check in the rules to allow read and writes along with some custom data you provided while registration (so you can check these data from the rules). 而且,他们仍将获得一个用户ID,您将使用该用户ID来检入规则,以允许进行读写操作以及注册时提供的一些自定义数据(以便您可以从规则中检查这些数据)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM