public function requireLogin()
    {
        $qop = '';
        switch ($this->qop) {
            case self::QOP_AUTH:
                $qop = 'auth';
                break;
            case self::QOP_AUTHINT:
                $qop = 'auth-int';
                break;
            case self::QOP_AUTH | self::QOP_AUTHINT:
                $qop = 'auth,auth-int';
                break;
        }

        $this->response->addHeader('WWW-Authenticate', 'Digest realm="'.$this->realm.'",qop="'.$qop.'",nonce="'.$this->nonce.'",opaque="'.$this->opaque.'"');
        $this->response->setStatus(401);
    }
public function requireLogin()
    {
        $qop = '';
        switch ($this->qop) {
            case self::QOP_AUTH:
                $qop = 'auth';
                break;
            case self::QOP_AUTHINT:
                $qop = 'auth-int';
                break;
            case self::QOP_AUTH | self::QOP_AUTHINT:
                $qop = 'auth,auth-int';
                break;
        }

        $this->response->addHeader('WWW-Authenticate', 'Digest realm="'.$this->realm.'",qop="'.$qop.'",nonce="'.$this->nonce.'",opaque="'.$this->opaque.'"');
        $this->response->setStatus(401);
    }
public function requireLogin ( ) { $ qop = '' ; switch ( $ this -> qop ) { case self :: QOP_AUTH : $ qop = 'auth' ; break ; case self :: QOP_AUTHINT : $ qop = 'auth-int' ; break ; case self :: QOP_AUTH | self :: QOP_AUTHINT : $ qop = 'auth,auth-int' ; break ; } $ this -> response -> addHeader ( 'WWW-Authenticate' , 'Digest realm="' . $ this -> realm . '",qop="' . $ qop . '",nonce="' . $ this -> nonce . '",opaque="' . $ this -> opaque . '"' ) ; $ this -> response -> setStatus ( 401 ) ; }
Returns an HTTP 401 header, forcing login.

This should be called when username and password are incorrect, or not supplied at all
Returns an HTTP 401 header forcing login .