I can't validate zoom webhook in php laravel

i’m trying to validate webook in php laravel but is not working at pls i need help

I actually figured it out my self, hope it will help others trying to verify signature and validate webhook endpoint url.
Here is the code snippet:

        $message = 'v0:'.$request->header('x-zm-request-timestamp').':'.$request->getContent();
        $hash = hash_hmac('sha256', $message, 'Zoom_Secret_Token');
        $signature = "v0={$hash}";
        $verified = hash_equals($request->header('x-zm-signature'), $signature);
            $zoomData = json_decode($request->getContent(), true);
            $zoomSecret = 'Zoom_Secret_Token';  
            $zoomPlainToken = $zoomData['payload']['plainToken'];
            $hash = hash_hmac('sha256', $zoomPlainToken, $zoomSecret);
            $reponseData['plainToken'] = $zoomPlainToken;
            $reponseData['encryptedToken'] = $hash;
            return response()->json($reponseData);

1 Like

Thank you! this best solution!