Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 392 Bytes
<?php
namespace Demo\Api\Auth;
use Datto\JsonRpc\Auth;
class BasicAuthHandler implements Auth\Handler
{
public function canHandle($method, $arguments)
{
return isset($_SERVER['PHP_AUTH_USER']);
}
public function authenticate($method, $arguments)
{
return $_SERVER['PHP_AUTH_USER'] === 'user'
&& $_SERVER['PHP_AUTH_PW'] === 'pass';
}
}