protected function authenticateOnServer($authUrl, $username, $password)
    {
        $response = $this->sendDigestAuthentication($authUrl, $username, $password);

        $httpCode = $response->getHttpCode();

        // If status code is not 200, something went wrong
        if (200 !== $httpCode) {
            throw new \Exception('Response with Status Code [' . $httpCode . '].', 500);
        }
    }