Validation fails even though response is correct

POST /api/v2/Website/zoom/verify

Description
My app Medspa Network is failing its validation for webhooks, i have copied the code directly from the Zoom example for Node and modified to it fit my Token. i can verify through PostMan that the API is working correctly and sending the correct data back in less than .3 seconds. I have also regenerated my token to ensure that it is up to date, and Verified that my ENV variabales are live and correct.

const hashForValidate = crypto.createHmac('sha256', process.env.ZOOM_WEBHOOK_SECRET_TOKEN).update(request.body.payload.plainToken).digest('hex')

  response.status(200)
  response.json({
    "plainToken": request.body.payload.plainToken,
    "encryptedToken": hashForValidate
  })

Error?
Validation Failed

How To Reproduce

  1. Send a POST to my endpoint medspanetwork[.com] /api/v2/Website/zoom/verify
  2. Obviously my token wont match the one you send, but you should still get a correctly formatted JSON response

@iSkeat you need to send status 200 together with the payload. it seems you are just sending status 200 by itself as the first response.

something like this might work

res.status(200).json({
      "plainToken": req.body.payload.plainToken,
      "encryptedToken": hashForValidate
    });

Hi Chun,
Unfortunately thats not quite how Node and Express work.
Setting the status before the response data is valid. However, i did try your suggestion as well. It still did not validate.

HI there has been a new development!
Using NGROK and the SAME EXACT CODE the verification passed.
I am now wondering if it is an AWS ec2 issue… or CENTOS issue

Restarted NGINX and now everything works… idk

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.