This commit is contained in:
Marco Palladino
2012-04-06 12:39:07 -07:00
parent f02375cfb8
commit 149e80f8eb
2 changed files with 2 additions and 7 deletions

4
README
View File

@@ -1,4 +0,0 @@
Mashape PHP client library v0.4
Copyright (C) 2011 Mashape, Inc.
For the documentation, please visit http://www.mashape.com/guide/consume/php

View File

@@ -27,9 +27,8 @@
class AuthUtil { class AuthUtil {
public static function generateAuthenticationHeader($publicKey, $privateKey) { public static function generateAuthenticationHeader($publicKey, $privateKey) {
$uuid = uniqid(); $hash = hash_hmac("sha1", $publicKey, $privateKey);
$hash = hash_hmac("sha1", $uuid, $privateKey); $header = "Proxy-Authorization: " . base64_encode($publicKey . ":" . $hash) . "\r\n";
$header = "X-Mashape-Authorization: " . base64_encode($publicKey . ":" . $hash . $uuid) . "\r\n";
return $header; return $header;
} }