void HTTPCredentials::authenticate(HTTPRequest& request, const HTTPResponse& response) { for (HTTPResponse::ConstIterator iter = response.find("WWW-Authenticate"); iter != response.end(); ++iter) { if (isBasicCredentials(iter->second)) { HTTPBasicCredentials(_digest.getUsername(), _digest.getPassword()).authenticate(request); return; } else if (isDigestCredentials(iter->second)) { _digest.authenticate(request, HTTPAuthenticationParams(iter->second.substr(7))); return; } } }
void HTTPDigestCredentials::proxyAuthenticate(HTTPRequest& request, const HTTPResponse& response) { proxyAuthenticate(request, HTTPAuthenticationParams(response)); }