PHP Class Psr7Middlewares\Middleware\BasicAuthentication

Inheritance: use trait Psr7Middlewares\Utils\AuthenticationTrait
Afficher le fichier Open project: oscarotero/psr7-middlewares

Méthodes publiques

Méthode 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.

Private Methods

Méthode Description
checkUserPassword ( string $username, string $password ) : boolean Validate the user and password.
parseAuthorizationHeader ( string $header ) : false | array Parses the authorization header for a basic authentication.

Method Details

__invoke() public méthode

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
Résultat Psr\Http\Message\ResponseInterface

getUsername() public static méthode

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