Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Wrapper libraries >

Webhook intent to receive validation in c# never matched

Started by Anton Salim -   in Wrapper libraries

I have used the code from the following sample project: https://github.com/XeroAPI/XeroWebhooksReceiver

The generated xero signature never matched the calculated hash value.
Anyone can shed any light? Thanks.


//LINQPad code
This code is provided by the developer community - Xero does not warrant it in any way
Hey Anton,

Check out these resources by my colleague Jason on the topic:

https://devblog.xero.com/getting-started-with-xero-webhooks-and-net-cbda8b7f5b5
https://www.youtube.com/watch?v=b2JLYcv6Qh8

Typically the issue is that the raw http request has been manipulated or altered in some way if the signature never matches.
 

Rett Behrens (Xero Staff)  

Thanks Rett,
As I am using Logic App's Http Trigger to receive the request from Xero and passing the payload to an Azure function, I suspect as you said, the raw body has been automatically altered.

I found that sending the request directly to an Azure function works.
 

Anton Salim  

Anton,

Are you using the HTTP Trigger or the HTTP Webhook Trigger? From looking at the docs they seem to be two distinct workflows.

https://docs.microsoft.com/en-us/azure/connectors/connectors-native-webhook
 

Rett Behrens (Xero Staff)  

Rett, not the Webhook trigger. That is used to create webhooks not to consume them.
I have solved the issue by reconstructing the payload based on the format used by Xero. Logic App trigger modifies the format which cause the verification to fail all the time.
 

Anton Salim