
Webhook intent to receive validation in c# never matched
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
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
5
Replies

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.
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.

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.
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,
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
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, 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.
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.

hi anton,
how did you reconstruct the payload? i am having the same issue in power automate. i am creating the hash using encodian action 'create hmac' using the 'body' output from the request but still not matching. also it seems that xero is sending out only 3 intents rather than 4?
thank you!
how did you reconstruct the payload? i am having the same issue in power automate. i am creating the hash using encodian action 'create hmac' using the 'body' output from the request but still not matching. also it seems that xero is sending out only 3 intents rather than 4?
thank you!