Psr7Middlewares\Middleware\DigestAuthentication::login PHP Метод

login() приватный Метод

Login or check the user credentials.
private login ( Psr\Http\Message\ServerRequestInterface $request, string | null &$username ) : boolean
$request Psr\Http\Message\ServerRequestInterface
$username string | null
Результат boolean
    private function login(ServerRequestInterface $request, &$username)
    {
        //Check header
        $authorization = self::parseAuthorizationHeader($request->getHeaderLine('Authorization'));
        if (!$authorization) {
            return false;
        }
        //Check whether user exists
        if (!isset($this->users[$authorization['username']])) {
            return false;
        }
        $username = $authorization['username'];
        //Check authentication
        return $this->checkAuthentication($authorization, $request->getMethod(), $this->users[$username]);
    }