Skip to main content
Question

HMAC Validation

  • January 13, 2025
  • 1 reply
  • 34 views

Forum|alt.badge.img+1

I am writing an app to download documents after being signed to integrate into our in-house application.

I am having a little trouble with “public static bool HashIsValid(string secret, string payload, string verify)”

In the development environment this works without error.

I create a document, sign it and via connect the json and headers are sent to webhook.site

I pick up the json and x-docusign-signature-1.  I place the HMAC from development connect as the secret, the json as the payload, and x-docusign-signature-1 as verify and my json verifies.

In production I do the same, I place the HMAC from admin connect as the secret, the json as the payload, and x-docusign-signature-1 as verify, but it always fails.

I have also published this application out for testing.  I change connect to use the URL of my application.  I read the HMAC for development, the json and x-docusign-signature-1 are read from what DocuSign sends.  The HMAC is validated and the document is stored in the appropriate directory.

I then go to production, set my connect URL to my application.  The HMAC for production is read in and of course the json and x-docusign-signature-1 are read from what DocuSign sends.

Production HMAC always fails


Has anyone else had issues using HMAC and HashIsValid in production?

Thanks,

Dennis W. Watson

1 reply

Forum|alt.badge.img+7
  • Docusign Employee
  • 66 replies
  • January 15, 2025

I tested the code introduced on this page (https://developers.docusign.com/platform/webhooks/connect/validate/) on both the Demo and Prod environments, and both worked without issue. I would recommend you check and confirm whether

  1. the payload is passed as it is without a new line or space
  2. the HMAC secret is correct (I would recommend you remove the current secret and recreate the new one on the Production Docusign Portal)
  3. the value of the verify is passed as it is.