本文介绍了谷歌云功能http认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Google云功能的新手,并尝试仅通过dialogflow webhooks的请求来限制对我功能的访问.我在gcloud控制台中看到两个选项:允许未经身份验证的请求和受用户帐户限制.我不了解如何实施身份验证. Dialogflow webhooks具有用于设置在webhook请求中设置的http标头的选项.但是gcloud控制台没有接口/选项来获取我可以写为http身份验证标头的任何数据.因此,我只能在云功能中看到选项实现身份验证流程,但是为什么Google会添加选项来限制通过HTTP身份验证的访问.谁能给我一个分步示例示例,如何从dialogflow webhooks获取在云功能上实现HTTP身份验证所需的HTTP标头名称和数据?

I am new to google cloud functions and try to restrict access to my function by only requests from dialogflow webhooks. I see two options in gcloud console: allow unauthenticated requests and restrict by user accounts. I don't understand how to implement that authentication. Dialogflow webhooks has options to set http headers that sets in webhook requests. But gcloud console hasn't interface/options to obtain any data that I can write as http authentication header. So I see only option implement authetication flow in cloud function, but in that way why google added option to restrict access by http authentication. Can anyone give me an example step-by-step example how to obtain http headers names and data needed to implement http authentication on cloud functions from dialogflow webhooks?

推荐答案

没有内置的身份验证,您必须自己执行.您此处有一些指南

There isn't built in authentication, you have to perform it by yourselves. You have some guidance here in the Google Cloud Documentation

总而言之,将您的函数设置为public(允许未经身份验证),然后在代码中执行检查.

In summary, set your function public (allow unauthenticated) and perform the check in your code.

这篇关于谷歌云功能http认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 17:24
查看更多