Webhook URL Is Not Validating With Production URL

I am facing an issue with Webhook in that the that the URL is not validating.

I am developing an application in Zoom, so when I use the Ngrok URL, event notification endpoint URL [production] will be validated, but when I host my web application in Catalyst, it will not be validated with the production URL. When I deploy into Catalyst, the URL will be generated in the developing mode, so I am converting it into the production URL, which is the URL I have given in the web application URL in the event notification endpoint URL [production]. It will not validate the same process when I use Ngrok.

Nodejs Code to validating the End point URL:

const message = `v0:${req.headers['x-zm-request-timestamp']}:${JSON.stringify(req.body)}`
  console.log("Message :", message)
  const hashForVerify = crypto.createHmac('sha256', process.env.ZOOM_WEBHOOK_SECRET_TOKEN).update(message).digest('hex')
  // hash the message string with your Webhook Secret Token and prepend the version semantic
  const signature = `v0=${hashForVerify}`
  if (req.headers['x-zm-signature'] === signature) {
    if (req.body.event === 'endpoint.url_validation') {
      const hashForValidate = crypto.createHmac('sha256', process.env.ZOOM_WEBHOOK_SECRET_TOKEN).update(req.body.payload.plainToken).digest('hex')
      response = {
        message: {
          plainToken: req.body.payload.plainToken,
          encryptedToken: hashForValidate
        },
        status: 200
      }
      console.log(response.message)
      res.status(response.status)
      res.json(response.message)
    } else {
      response = { message: 'Authorized request to Zoom Webhook.', status: 200 }
      console.log("response", response.message)
      res.status(response.status)
      res.json(response)
      // business logic here, example make API request to Zoom or 3rd party
      console.log("Upload into workdrive...");

Note: This code will be working good when i was use Ngrok so the problem is after deploying the application URL is not validating.

I’m having the exact same problem. Everything works fine when I test zoom webhooks using ngrok tunneling, but when I swap to use my production URL with the same code I can see that the header field x-zm-signature and the signature I generate suddenly doesn’t match in production. Does anyone have a hint as to why that is?