Support for authentication
This commit is contained in:
24
main/mashape/auth/BasicAuth.php
Normal file
24
main/mashape/auth/BasicAuth.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
require_once(dirname(__FILE__) . "/HeaderAuth.php");
|
||||
|
||||
class BasicAuth extends HeaderAuth {
|
||||
|
||||
private $header;
|
||||
|
||||
function __construct($username, $password) {
|
||||
$headerValue = $username . ":" . $password;
|
||||
$this->header = "Authorization: " . base64_encode($headerValue);
|
||||
}
|
||||
|
||||
public function handleHeader() {
|
||||
return $this->header;
|
||||
}
|
||||
|
||||
public function handleParams() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user