Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud firestore 如何允许依赖于其登录选项的用户访问数据_Google Cloud Firestore_Firebase Authentication - Fatal编程技术网

Google cloud firestore 如何允许依赖于其登录选项的用户访问数据

Google cloud firestore 如何允许依赖于其登录选项的用户访问数据,google-cloud-firestore,firebase-authentication,Google Cloud Firestore,Firebase Authentication,我想让我的Firebase后端更安全。我相信每个登录到我的Firebase的人都可以编辑一个文件夹。问题是:我的用户也可以匿名登录。这意味着用户可以使用anonymous登录,并可以更改文件夹中的数据 我想要的是,只有那些使用电子邮件密码登录的人才能访问此文件夹。是否有办法在Firestore规则代码中获取登录选项(电子邮件+密码或匿名) 谢谢你的时间 Boothosh在Firestore规则中,您可以访问提供的request.auth。从这里可以看到,您可以访问firebase.sign\u

我想让我的Firebase后端更安全。我相信每个登录到我的Firebase的人都可以编辑一个文件夹。问题是:我的用户也可以匿名登录。这意味着用户可以使用anonymous登录,并可以更改文件夹中的数据

我想要的是,只有那些使用电子邮件密码登录的人才能访问此文件夹。是否有办法在Firestore规则代码中获取登录选项(电子邮件+密码或匿名)

谢谢你的时间


Boothosh

在Firestore规则中,您可以访问提供的
request.auth
。从这里可以看到,您可以访问
firebase.sign\u in\u provider
,并可以在Firestore规则的逻辑中使用它

我建议您浏览全文,了解哪些数据可用于实现安全逻辑