1

我正在尝试协调 Twilio 的建议和安全最佳实践。

我最初使用 SID 和 auth-token 编写应用程序。

https://www.twilio.com/docs/usage/rest-api-best-practices说:

“我们推荐使用 API Keys”

所以我正在将 python 助手休息客户端转换为使用 api key/secret 进行初始化

并且由于这是一个 webhook 身份验证,请遵循以下安全做法: https ://www.twilio.com/docs/usage/security#validating-requests

使用: https ://www.twilio.com/docs/usage/tutorials/how-to-secure-your-flask-app-by-validating-incoming-twilio-requests

但是,这似乎只支持 auth_token

这是否意味着无法在 webhook 应用程序中使用 API 密钥?

如果我还必须设置 auth_token 秘密,那么在应用程序配置中使用 API 密钥秘密似乎很愚蠢。

4

1 回答 1

1

Twilio employee here

Looks like you've spotted an inconsistency in our guidance. You are correct: if your app receives incoming webhooks from Twilio and you want to validate the signature of those incoming requests, you cannot use API keys to do so - you must use your account's Auth Token.

I just fixed the first doc you linked to so it reflects that guidance. Thank you for raising this with us and my apologies for the inconsistency in our docs!

于 2020-12-03T22:38:51.770 回答