30 $auth = $this->request->getHeader(
'Authorization');
36 if (strtolower(substr(
$auth, 0, 6)) !==
'basic ') {
40 $credentials = explode(
':', base64_decode(substr(
$auth, 6)), 2);
42 if (2 !== count($credentials)) {
58 $this->response->addHeader(
'WWW-Authenticate',
'Basic realm="' . $this->realm .
'", charset="UTF-8"');
59 $this->response->setStatus(401);
An exception for terminatinating execution or to throw for unit testing.
HTTP Authentication base class.
HTTP Basic authentication utility.
requireLogin()
This method sends the needed HTTP header and statuscode (401) to force the user to login.
getCredentials()
This method returns a numeric array with a username and password as the only elements.