Content
You are here:
Webhook hmac signature with php
Added by Thomas Keil over 3 years ago
Hello everyone,
I'm trying to connect OpenProject to a PHP-Script, which works fine, but I can't generate a correct hmac-hash to verify OpenProject as sender.
This is my code:
$rawdata = file_get_contents("php://input");
$hash = hash_hmac("sha1", $rawdata, "test123");
Quite simple, my keys are the same (checked that like 1000 times), but the hashes differ.
The Request's header states: 3ce4bf27a90fd773cf9b2fd1f0cd4f6c850a9263
but my hash is actually 6396bacdb89cca760fb102f4ed2b081f31ca8e5a
What am I doing wrong? Is the raw body somehow encoded that needs decoding first, or something else that I missed?
Thanks for your help
Thomas