auth
This commit is contained in:
@@ -29,9 +29,8 @@ class AuthUtil {
|
||||
public static function generateAuthenticationHeader($publicKey, $privateKey) {
|
||||
$header = "";
|
||||
if (!($publicKey == null || $privateKey == null)) {
|
||||
$uuid = uniqid();
|
||||
$hash = hash_hmac("sha1", $uuid, $privateKey);
|
||||
$header = "X-Mashape-Authorization: " . base64_encode($publicKey . ":" . $hash . $uuid) . "\r\n";
|
||||
$hash = hash_hmac("sha1", $publicKey, $privateKey);
|
||||
$header = "Proxy-Authorization: " . base64_encode($publicKey . ":" . $hash) . "\r\n";
|
||||
}
|
||||
return $header;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user