首页 文章

如何保护dialogflow webhook(使用firebase功能)?

提问于
浏览
1

我正在开发一个对话框流程代理,其中包含firebase函数中的实现webhook(使用Google客户端库上的操作) . 如何保护它只让我的代理可以访问这些功能?

我阅读了以下文档,但没有提供有关其实现的任何进一步细节 .

https://dialogflow.com/docs/fulfillment/configure#authentication

It's important to secure your webhook to prevent unwanted, potentially malicious calls. Dialogflow supports two mechanisms for authentication:

Basic authentication with login and password.
Authentication with additional authentication headers.

1 回答

  • 1

    Dialogflow提供了这两种方式,可以灵活地保护您的webhook .

    如果您正在使用负载均衡器和API网关,或者在您的webhook前面有防火墙 - 如果他们没有将特定标头设置为特定标头,您可以将该系统阻止请求发送到您的webhook路径值或者他们是否使用在系统中没有有效帐户的Basic auth发出请求 .

    如果您使用action-on-google库,则可以在创建 dialogflow 对象时强制匹配auth或标头,如果它们不匹配,则可以拒绝该请求set the verification parameter .

相关问题