Google cloud functions http authentication

时间秒杀一切 提交于 2020-07-28 04:22:27

问题


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?


回答1:


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

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



来源:https://stackoverflow.com/questions/61017762/google-cloud-functions-http-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!