PHP Class Psr7Middlewares\Middleware\DigestAuthentication

See also: https://tools.ietf.org/html/rfc2069#page-10
Inheritance: use trait Psr7Middlewares\Utils\AuthenticationTrait, use trait Psr7Middlewares\Utils\AttributeTrait
Datei anzeigen Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
getUsername ( Psr\Http\Message\ServerRequestInterface $request ) : string | null Returns the username.
nonce ( string $nonce ) : self Set the nonce value.

Private Methods

Method Description
checkAuthentication ( array $authorization, string $method, string $password ) : boolean Validates the user authentication.
login ( Psr\Http\Message\ServerRequestInterface $request, string | null &$username ) : boolean Login or check the user credentials.
parseAuthorizationHeader ( string $header ) : false | array Parses the authorization header for a basic authentication.

Method Details

__invoke() public method

Execute the middleware.
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$next callable
return Psr\Http\Message\ResponseInterface

getUsername() public static method

Returns the username.
public static getUsername ( Psr\Http\Message\ServerRequestInterface $request ) : string | null
$request Psr\Http\Message\ServerRequestInterface
return string | null

nonce() public method

Set the nonce value.
public nonce ( string $nonce ) : self
$nonce string
return self