将Webhook请求发送到Firebase https onRequest云功能得到403响应

时间:2020-03-27 16:05:17

标签: firebase google-cloud-functions

我在ABC中将我的Firebase云功能之一注册为Webhook URL。如果发生任何事件,ABC会将webhook请求发送到我的函数URL。但是webhook请求始终得到403响应,而我的云功能也从未触发过。

所以我的问题是firebase会阻止任何IP向云功能服务器发送请求吗?还是外部请求收到403错误的任何可能原因?

谢谢!

2 个答案:

答案 0 :(得分:1)

我从this post那里得到了答案

1. Go to the cloud function tab
2. Select your cloud function (check box)
3. Click "Add members" under Permissions tab in the right side
4. Enter "allUsers" under "New memebers"
5. Select Role as "Cloud Functions -> Cloud Functions Invoker"
6. Save
7. Test your cloud function by just pasting it in the browser

答案 1 :(得分:0)

我发现这很有帮助: https://cloud.google.com/functions/docs/securing/managing-access-iam#allowing_unauthenticated_function_invocation

Google现在似乎要求将这些功能明确地列入allUsers用户的白名单...