【问题标题】:How to use intuit webhook verifier token on a webhook如何在 webhook 上使用 intuit webhook 验证器令牌
【发布时间】:2020-08-03 00:37:05
【问题描述】:

我使用 intuit 开发者帐户创建了一个 webhook https://developer.intuit.com/app/developer/qbo/docs/develop/webhooks#configuring-webhooks

它工作正常,我的问题是如何使用验证者令牌来保护 webhook?

我看到了各种直观的标题,但不知道如何使用它们

【问题讨论】:

    标签: ruby-on-rails intuit


    【解决方案1】:

    有详细的文档

    1. 使用您的验证者令牌作为密钥,使用 HMAC_SHA256_ALGORITHM 对通知负载进行哈希处理。
    2. 将 intuit-signature 标头从 base-64 转换为 base-16。
    3. 将步骤 1 中的值与通知中的 intuit-signature 标头进行比较。这些值应该相同。

    https://developer.intuit.com/app/developer/qbo/docs/develop/webhooks/managing-webhooks-notifications#validating-the-notification

    这里有更多信息如何生成 HMAC 哈希 (Using HMAC SHA256 in Ruby) 以及如何将 base64 签名转换为 base16 (Converting a hexadecimal digest to base64 in Ruby)。为了比较这些值,Rails 确实实现了 safe_compare 方法 (https://api.rubyonrails.org/classes/ActiveSupport/SecurityUtils.html)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 2019-01-17
      • 1970-01-01
      • 1970-01-01
      • 2023-01-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多