@ 2013-10-24T15:28:05Z <?php
$request = 'POST';
// I've set the callback url to http://signature.wix.codeoasis.com/
// I've tried with and without the '/' (ie $url = '')
$url = '/';
$headers = array(
'X-Wix-Signature' => '3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik',
"X-Wix-Instance-Id" => "132fc751-9325-63d3-a605-f74e0c25192a",
"X-Wix-Event-Id" => "da390885-e72f-4a93-be7f-a90220bac5c7",
"X-Wix-Event-Type" => "/provision/provision",
"X-Wix-Timestamp" => "2013-10-23T15:39:34.462Z",
"X-Wix-Application-Id" => "132fbf95-d58e-f9ed-86e8-48b76f901d91"
);
//$body = "{\n\t\"instance-id\": \"1328a7fe-e451-8780-d201-0c5d9a1fc02b\"\n}";
$body = '{"instance-id":"132fc751-9325-63d3-a605-f74e0c25192a"}';
// The app secret provided by Wix
$appSecret = "97cfac6e-b061-4007-a03e-eb4bc199e620";
function concat($request, $url, $headers, $body)
{
// Request Method and Url separated by \n
$result = trim($request);
$result .= "\n";
$result .= trim($url);
$result .= "\n";
// Sort Wix-* headers by key
ksort($headers);
// concatenate Wix-* headers (trimmed and separate by comma)
$first = true;
foreach ($headers as $key => $value) {
if ($key != 'X-Wix-Signature' && $first == true) {
$result = $result . trim($value);
$first = false;
} else if ($key != 'X-Wix-Signature') {
$result = $result . '\n' . trim($value);
}
}
// Add body
$result = $result . "\n" . trim($body);
return $result;
}
$concat = concat($request, $url, $headers, $body);
// Encrypt with hmac and app secret
$encrypted = hash_hmac('sha256', $concat, $appSecret);
//$base64 = base64_encode($encrypted);
echo "The computed signature is : " . $encrypted . "\n";
echo "The signature sent by Wix : " . $headers['X-Wix-Signature'];
// The received request on http://signature.wix.codeoasis.com/
//
// {
// "Host": "signature.wix.codeoasis.com",
// "X-Wix-Signature": "3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik",
// "X-Wix-Instance-Id": "132fc751-9325-63d3-a605-f74e0c25192a",
// "X-Wix-Event-Id": "da390885-e72f-4a93-be7f-a90220bac5c7",
// "Content-Type": "application/json; charset=utf-8",
// "X-Wix-Event-Type": "/provision/provision",
// "X-Wix-Timestamp": "2013-10-23T15:39:34.462Z",
// "X-Wix-Application-Id": "132fbf95-d58e-f9ed-86e8-48b76f901d91",
// "Connection": "keep-alive",
// "Accept": "*/*",
// "User-Agent": "Dispatch/0.10.1",
// "Content-Length": "54",
// "body":
// {
// "instance-id":"132fc751-9325-63d3-a605-f74e0c25192a"
// }
// }
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 5.1.2 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.30 , 7.0.0 - 7.0.20 , 7.1.0 - 7.1.20 , 7.2.0 - 7.2.33 , 7.3.12 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 The computed signature is : de7ad2a60c053572571f81e32a4abc07074af37eee370f0cdc9c5583b879a8ca
The signature sent by Wix : 3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik Output for 5.0.0 - 5.0.5 , 5.1.1 Fatal error: Call to undefined function hash_hmac() in /in/Zks5O on line 53
Process exited with code 255 . Output for 5.1.0 Fatal error: fatal flex scanner internal error--end of buffer missed in /in/Zks5O on line 79
Process exited with code 255 . Output for 4.4.5 - 4.4.9 Fatal error: Call to undefined function: hash_hmac() in /in/Zks5O on line 53
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.4 Fatal error: Call to undefined function: hash_hmac() in /in/Zks5O on line 53
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Call to undefined function: hash_hmac() in /in/Zks5O on line 53
preferences:dark mode live preview
233.07 ms | 401 KiB | 372 Q