I create a proof of concept asp.net C# application to receive the WooCommerce Webhook requests. Unfortunately it seems that by default WooCommerce WebHooks don't integrate well with the ASP.NET Webhook receiver. After finding out that I should use the custom Webhook instead of the Wordpress Webhook receiver, I now have problems with the signature.
Naturally I would like to keep the WooCommerce plugin completely vanilla, however I now added the secret directly into a new header attribute 'ms-signature'. I can't get the custom Webhook receiver to accept it though.
I am getting the error:
The WebHook signature provided by the 'ms-signature' header field does not match the value expected by the 'CustomWebHookReceiver' receiver. WebHook request is invalid.
I got the following secret in the web.config which I use as the WooCommerce secret as well.
> <appSettings>
> <add key="MS_WebHookReceiverSecret_Custom" value="7077693b67c9441a3dbbdbe7ac5b655ffdb323a40fd4ff7535d54c8f10e10582"/>
> </appSettings>
I tried a number of things but I think the way the signature should be used from WooCommerce needs to be changed for the custom receiver to accept it.
Could someone explain me what the ASP.NET webhook expects and how I could best change my solution?
The Custom receiver is intended for WebHooks generated by ASP.NET WebHooks so that won't work. Can you instead either try the WordPress Receiver or the Generic Json WebHook Receiver.
You can find them in two Nugets:
http://www.nuget.org/packages/Microsoft.AspNet.WebHooks.Receivers.WordPress/ http://www.nuget.org/packages/Microsoft.AspNet.WebHooks.Receivers.Generic/
Hope this helps,
Henrik