(No version information available, might be only in CVS)
KRB5NegotiateAuth::doAuthentication — Performs HTTP Negotiate authentication
This method performs HTTP Negotiate authentication. It will fetch the provided credentials from the request headers and set the response headers appropriately to perform authentication.
This function has no parameters.
Returns true when authentication was successful, false otherwise.
Example #1 KRB5NegotiateAuth::doAuthentication() example
<?php
$auth = new KRB5NegotiateAuth('/etc/krb5.keytab');
if($auth->doAuthentication()) {
echo 'Success - authenticated as ' . $auth->getAuthenticatedUser();
try {
$cc = new KRB5CCache();
$auth->getDelegatedTicket($cc);
} catch (Exception $error) {
echo 'No delegated credentials available';
}
} else {
if(!empty($_SERVER['PHP_AUTH_USER'])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic', false);
} else {
// verify basic authentication data
echo 'authenticated using BASIC method<br />';
}
}
?>