This commit is contained in:
thefosk
2013-02-20 00:43:14 +01:00
parent a6f07cd415
commit 64704384db
2 changed files with 4 additions and 9 deletions

View File

@@ -26,13 +26,8 @@
class AuthenticationUtil {
public static function generateAuthenticationHeader($publicKey, $privateKey) {
$header = "";
if (!($publicKey == null || $privateKey == null)) {
$hash = hash_hmac("sha1", $publicKey, $privateKey);
$header = "X-Mashape-Authorization: " . base64_encode($publicKey . ":" . $hash);
}
return $header;
public static function generateAuthenticationHeader($mashapeKey) {
return "X-Mashape-Authorization: " . $mashapeKey;
}
}

View File

@@ -6,8 +6,8 @@ class MashapeAuthentication extends HeaderAuthentication {
private $headers;
function __construct($publicKey, $privateKey) {
$this->headers = array(AuthenticationUtil::generateAuthenticationHeader($publicKey, $privateKey));
function __construct($mashapeKey) {
$this->headers = array(AuthenticationUtil::generateAuthenticationHeader($mashapeKey));
}
public function handleHeaders() {