<?php
$request = 'POST';
$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"}';
$key = "97cfac6e-b061-4007-a03e-eb4bc199e620";
function concat($request, $url, $headers, $body)
{
$result = '';
$result .= trim($request);
$result .= "\n";
$result .= trim($url);
$result .= "\n";
ksort($headers);var_dump($headers);
$first = true;
foreach ($headers as $header) {
if ($header != 'X-Wix-Signature' && $first == true) {
$result = $result . trim($header);
$first = false;
} else if ($header != 'X-Wix-Signature') {
$result = $result . ',' . trim($header);
}
}
$result = $result . "\n" . trim($body);
return $result;
}
$concat = concat($request, $url, $headers, $body);
$encrypted = hash_hmac('sha256', $concat, $key);
//$base64 = base64_encode($encrypted);
echo "The computed signature is : " . $encrypted . "\n";
echo "The signature sent by Wix : " . $headers['X-Wix-Signature'];
- 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.7, 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.3 - 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
- array(6) {
["X-Wix-Application-Id"]=>
string(36) "132fbf95-d58e-f9ed-86e8-48b76f901d91"
["X-Wix-Event-Id"]=>
string(36) "da390885-e72f-4a93-be7f-a90220bac5c7"
["X-Wix-Event-Type"]=>
string(20) "/provision/provision"
["X-Wix-Instance-Id"]=>
string(36) "132fc751-9325-63d3-a605-f74e0c25192a"
["X-Wix-Signature"]=>
string(43) "3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik"
["X-Wix-Timestamp"]=>
string(24) "2013-10-23T15:39:34.462Z"
}
The computed signature is : 2a961bcd9ccfd830d9ddb0453ea5e0fbcf617de10c6aec6f6a410708740147a4
The signature sent by Wix : 3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik
- Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
- array(6) {
["X-Wix-Application-Id"]=>
string(36) "132fbf95-d58e-f9ed-86e8-48b76f901d91"
["X-Wix-Event-Id"]=>
string(36) "da390885-e72f-4a93-be7f-a90220bac5c7"
["X-Wix-Event-Type"]=>
string(20) "/provision/provision"
["X-Wix-Instance-Id"]=>
string(36) "132fc751-9325-63d3-a605-f74e0c25192a"
["X-Wix-Signature"]=>
string(43) "3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik"
["X-Wix-Timestamp"]=>
string(24) "2013-10-23T15:39:34.462Z"
}
Fatal error: Call to undefined function hash_hmac() in /in/6uAoE on line 43
Process exited with code 255. - Output for 4.4.5 - 4.4.9
- array(6) {
["X-Wix-Application-Id"]=>
string(36) "132fbf95-d58e-f9ed-86e8-48b76f901d91"
["X-Wix-Event-Id"]=>
string(36) "da390885-e72f-4a93-be7f-a90220bac5c7"
["X-Wix-Event-Type"]=>
string(20) "/provision/provision"
["X-Wix-Instance-Id"]=>
string(36) "132fc751-9325-63d3-a605-f74e0c25192a"
["X-Wix-Signature"]=>
string(43) "3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik"
["X-Wix-Timestamp"]=>
string(24) "2013-10-23T15:39:34.462Z"
}
Fatal error: Call to undefined function: hash_hmac() in /in/6uAoE on line 43
Process exited with code 255. - Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
- array(6) {
["X-Wix-Application-Id"]=>
string(36) "132fbf95-d58e-f9ed-86e8-48b76f901d91"
["X-Wix-Event-Id"]=>
string(36) "da390885-e72f-4a93-be7f-a90220bac5c7"
["X-Wix-Event-Type"]=>
string(20) "/provision/provision"
["X-Wix-Instance-Id"]=>
string(36) "132fc751-9325-63d3-a605-f74e0c25192a"
["X-Wix-Signature"]=>
string(43) "3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik"
["X-Wix-Timestamp"]=>
string(24) "2013-10-23T15:39:34.462Z"
}
Fatal error: Call to undefined function: hash_hmac() in /in/6uAoE on line 43
Process exited with code 255. - Output for 4.3.0 - 4.3.1
- array(6) {
["X-Wix-Application-Id"]=>
string(36) "132fbf95-d58e-f9ed-86e8-48b76f901d91"
["X-Wix-Event-Id"]=>
string(36) "da390885-e72f-4a93-be7f-a90220bac5c7"
["X-Wix-Event-Type"]=>
string(20) "/provision/provision"
["X-Wix-Instance-Id"]=>
string(36) "132fc751-9325-63d3-a605-f74e0c25192a"
["X-Wix-Signature"]=>
string(43) "3elavUOF0-I1_7tGz2XZKs_HSlrygsMiblpNFPKv3Ik"
["X-Wix-Timestamp"]=>
string(24) "2013-10-23T15:39:34.462Z"
}
Fatal error: Call to undefined function: hash_hmac() in /in/6uAoE on line 43
preferences:
288.7 ms | 402 KiB | 366 Q