Library: Net
Package: HTTP
Header: Poco/Net/HTTPAuthenticationParams.h
Collection of name-value pairs of HTTP authentication header (i.e. "realm", "qop", "nonce" in case of digest authentication header).
Direct Base Classes: NameValueCollection
All Base Classes: NameValueCollection
Member Functions: fromAuthInfo, fromRequest, fromResponse, getRealm, operator =, setRealm, toString
Inherited Functions: add, begin, clear, empty, end, erase, find, get, has, operator =, operator [], set, size, swap
Creates an empty authentication parameters collection.
explicit HTTPAuthenticationParams(
const std::string & authInfo
);
See fromAuthInfo() documentation.
explicit HTTPAuthenticationParams(
const HTTPRequest & request
);
See fromRequest() documentation.
explicit HTTPAuthenticationParams(
const HTTPResponse & response
);
See fromResponse() documentation.
virtual ~HTTPAuthenticationParams();
Destroys the HTTPAuthenticationParams.
void fromAuthInfo(
const std::string & authInfo
);
Creates an HTTPAuthenticationParams by parsing authentication information.
void fromRequest(
const HTTPRequest & request
);
Extracts authentication information from the request and creates HTTPAuthenticationParams by parsing it.
Throws a NotAuthenticatedException if no authentication information is contained in request. Throws a InvalidArgumentException if authentication scheme is unknown or invalid.
void fromResponse(
const HTTPResponse & response
);
Extracts authentication information from the response and creates HTTPAuthenticationParams by parsing it.
Throws a NotAuthenticatedException if no authentication information is contained in response. Throws a InvalidArgumentException if authentication scheme is unknown or invalid.
const std::string & getRealm() const;
Returns value of the "realm" parameter.
Throws NotFoundException is there is no "realm" set in the HTTPAuthenticationParams.
HTTPAuthenticationParams & operator = (
const HTTPAuthenticationParams & authParams
);
Assigns the content of another HTTPAuthenticationParams.
void setRealm(
const std::string & realm
);
Sets the "realm" parameter to the provided string.
std::string toString() const;
Formats the HTTPAuthenticationParams for inclusion in HTTP request or response authentication header.
static const std::string REALM;