ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
HTTP Digest Authentication handler. More...
Public Member Functions | |
__construct ($realm='SabreTooth', RequestInterface $request, ResponseInterface $response) | |
Initializes the object. More... | |
init () | |
Gathers all information from the headers. More... | |
setQOP ($qop) | |
Sets the quality of protection value. More... | |
validateA1 ($A1) | |
Validates the user. More... | |
validatePassword ($password) | |
Validates authentication through a password. More... | |
getUsername () | |
Returns the username for the request. More... | |
requireLogin () | |
Returns an HTTP 401 header, forcing login. More... | |
getDigest () | |
This method returns the full digest string. More... | |
Public Member Functions inherited from Sabre\HTTP\Auth\AbstractAuth | |
__construct ($realm='SabreTooth', RequestInterface $request, ResponseInterface $response) | |
Creates the object. More... | |
requireLogin () | |
This method sends the needed HTTP header and statuscode (401) to force the user to login. More... | |
getRealm () | |
Returns the HTTP realm. More... | |
Data Fields | |
const | QOP_AUTH = 1 |
These constants are used in setQOP();. More... | |
const | QOP_AUTHINT = 2 |
Protected Member Functions | |
validate () | |
Validates the digest challenge. More... | |
parseDigest ($digest) | |
Parses the different pieces of the digest string into an array. More... | |
Protected Attributes | |
$nonce | |
$opaque | |
$digestParts | |
$A1 | |
$qop = self::QOP_AUTH | |
Protected Attributes inherited from Sabre\HTTP\Auth\AbstractAuth | |
$realm | |
$request | |
$response | |
HTTP Digest Authentication handler.
Use this class for easy http digest authentication. Instructions:
Definition at line 30 of file Digest.php.
Sabre\HTTP\Auth\Digest::__construct | ( | $realm = 'SabreTooth' , |
|
RequestInterface | $request, | ||
ResponseInterface | $response | ||
) |
Initializes the object.
Definition at line 47 of file Digest.php.
References Sabre\HTTP\Auth\AbstractAuth\$realm.
Sabre\HTTP\Auth\Digest::getDigest | ( | ) |
This method returns the full digest string.
It should be compatibile with mod_php format and other webservers.
If the header could not be found, null will be returned
Definition at line 199 of file Digest.php.
Referenced by Sabre\HTTP\Auth\Digest\init().
Sabre\HTTP\Auth\Digest::getUsername | ( | ) |
Sabre\HTTP\Auth\Digest::init | ( | ) |
Gathers all information from the headers.
This method needs to be called prior to anything else.
Definition at line 62 of file Digest.php.
References Sabre\HTTP\Auth\Digest\getDigest(), and Sabre\HTTP\Auth\Digest\parseDigest().
|
protected |
Parses the different pieces of the digest string into an array.
This method returns false if an incomplete digest was supplied
string | $digest |
Definition at line 214 of file Digest.php.
Referenced by Sabre\HTTP\Auth\Digest\init().
Sabre\HTTP\Auth\Digest::requireLogin | ( | ) |
Returns an HTTP 401 header, forcing login.
This should be called when username and password are incorrect, or not supplied at all
Definition at line 169 of file Digest.php.
References Sabre\HTTP\Auth\Digest\$qop.
Sabre\HTTP\Auth\Digest::setQOP | ( | $qop | ) |
Sets the quality of protection value.
Possible values are: Sabre::QOP_AUTH Sabre::QOP_AUTHINT
Multiple values can be specified using logical OR.
QOP_AUTHINT ensures integrity of the request body, but this is not supported by most HTTP clients. QOP_AUTHINT also requires the entire request body to be md5'ed, which can put strains on CPU and memory.
int | $qop |
Definition at line 85 of file Digest.php.
References Sabre\HTTP\Auth\Digest\$qop.
|
protected |
Validates the digest challenge.
Definition at line 136 of file Digest.php.
Referenced by Sabre\HTTP\Auth\Digest\validateA1(), and Sabre\HTTP\Auth\Digest\validatePassword().
Sabre\HTTP\Auth\Digest::validateA1 | ( | $A1 | ) |
Validates the user.
The A1 parameter should be md5($username . ':' . $realm . ':' . $password);
string | $A1 |
Definition at line 99 of file Digest.php.
References Sabre\HTTP\Auth\Digest\$A1, and Sabre\HTTP\Auth\Digest\validate().
Sabre\HTTP\Auth\Digest::validatePassword | ( | $password | ) |
Validates authentication through a password.
The actual password must be provided here. It is strongly recommended not store the password in plain-text and use validateA1 instead.
string | $password |
Definition at line 113 of file Digest.php.
References $password, and Sabre\HTTP\Auth\Digest\validate().
|
protected |
Definition at line 41 of file Digest.php.
Referenced by Sabre\HTTP\Auth\Digest\validateA1().
|
protected |
Definition at line 40 of file Digest.php.
|
protected |
Definition at line 38 of file Digest.php.
|
protected |
Definition at line 39 of file Digest.php.
|
protected |
Definition at line 42 of file Digest.php.
Referenced by Sabre\HTTP\Auth\Digest\requireLogin(), and Sabre\HTTP\Auth\Digest\setQOP().
const Sabre\HTTP\Auth\Digest::QOP_AUTH = 1 |
These constants are used in setQOP();.
Definition at line 35 of file Digest.php.
Referenced by Sabre\HTTP\Auth\DigestTest\getServerTokens(), and Sabre\HTTP\Auth\DigestTest\testDigestAuthBoth().
const Sabre\HTTP\Auth\Digest::QOP_AUTHINT = 2 |
Definition at line 36 of file Digest.php.
Referenced by Sabre\HTTP\Auth\DigestTest\getServerTokens(), Sabre\HTTP\Auth\DigestTest\testDigestAuthBoth(), and Sabre\HTTP\Auth\DigestTest\testDigestAuthInt().