PHP 脚本和 Firestore 之间的身份验证

时间:2021-05-21 06:45:13

标签: php firebase google-cloud-firestore firebase-authentication

我在 Firestore 中有一个运行 PHP 的后端服务和一个数据库。 PHP 上的脚本由来自其他服务的回调调用。这些服务或多或少地操作数据并将其写入我的 Firestore 数据库。在测试期间,我将规则设置为公开,但我想让这更安全。但是我不知道如何保护 PHP 脚本和 Firetore 之间的通信。我想一种方法是绑定 IP,但还有更多方法吗?所有调用都可以使用秘密盐和哈希来保护,但我想我想确保只有我的脚本页面可以进行调用。

最好的方法是什么?今天的连接是通过简单的 firebase 配置建立的。

1 个答案:

答案 0 :(得分:1)

Google 提供了一个 PHP 库,用于从 PHP 后端安全地与 Firestore 对话?。

https://github.com/googleapis/google-cloud-php-firestore