Skip to main content
Answered

Have anyone experienced fails with webhooks verification?

  • February 24, 2021
  • 2 replies
  • 160 views

Forum|alt.badge.img+1
  • Active User
  • 19 replies

I have some troubles with webhooks. For unknown reasons Webhook's verification fail for one particular customer. But not for all the time. Sometimes it succeeds (I'd say it fails 1 out of 10 ).

Do you have any tips on how to debug this issue? I logged the payload and it doesn't look suspicious. Just a regular user.tag.created event.

 

Here is how I verify webhook

```

const verifySignature = ({payload, secret, signature}) => {

const stringified = JSON.stringify(payload);

const calculatedSignature = `sha1=${crypto

.createHmac('sha1', secret)

.update(stringified)

.digest('hex')}`;

if (calculatedSignature !== signature) {

throw badRequest(`Invalid signature provided`);

}

};

export const verifyWebhook = ({clientSecret}) => async ({params, payload}) => {

verifySignature({

payload, //req.body parsed by koa-body

secret: clientSecret,

signature: params['x-hub-signature'],

});

return {id: payload.app_id};

};

```

Thanks in advance for any insigths!

Best answer by Jorge G

I have experienced issues in one of our systems while the other has never had issues (they manage different topics). The issue with the verification is related to the encoding, instead of UTF-8 the payload was validated succesfully if decoded with windows-1252 😲 , also happened with the user.tag.created topic. Could be a problem of out server configuration, I am still trying to figure it out

 

View original
Did this topic help you find an answer to your question?

2 replies

  • New Participant
  • 1 reply
  • Answer
  • June 30, 2021

I have experienced issues in one of our systems while the other has never had issues (they manage different topics). The issue with the verification is related to the encoding, instead of UTF-8 the payload was validated succesfully if decoded with windows-1252 😲 , also happened with the user.tag.created topic. Could be a problem of out server configuration, I am still trying to figure it out

 


Forum|alt.badge.img+1
  • Author
  • Active User
  • 19 replies
  • July 19, 2021

I sent this to the intercom support and they opened the issue in April. Hope it will get fixed some day


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings