I am struggling with the automated check for HMAC validation.
I can find some posts online stating that using a custom implementation of the validation works for them but it does not work for me.
I have and external admin dashboard as a NextJS app hosted on Vercel.
My webhooks are properly configured and work well on dev and prod.
I have both a custom hmac validator and the @shopify/shopify-apishopifyApi.webhooks.validate up and I can see that both are working fine using logs in prod and dev.
However - the automated check is consistently failing and I have no way to debug or get any information as to what exactly isn’t working or up to standard.
This is very frustrating and discouraging after spending a long time developing my app.
Please advice as to how to move forward as I am currently stuck.
The logs you mention, are those the ones in the developer dashboard, or somewhere else? If you haven’t checked the developer dashboard yet, that may give more insight in to how the webhooks are being received on our end.
Raw Body Parsing: Shopify’s HMAC verification requires the raw request body. If you’re using a body parser middleware like express.json(), it will parse the body before your webhook verification code gets to it. You need to capture the raw body before it’s parsed.
Buffered Raw Body: You should use the raw buffered body for the HMAC calculation.
Middleware Order: Ensure that your webhook verification middleware is placed before any body parsing middleware in your app.
Thanks @kfiroo. I would say at this point it would be worthwhile to reach out to our support team on this so they can take a look at your current app setup and see if anything stands out that would be blocking this check.