#include <icy/http/authenticator.h>Encodes and decodes HTTP Basic authentication credentials.
| Return | Name | Description |
|---|---|---|
BasicAuthenticator | Creates an empty basic authenticator. | |
BasicAuthenticator | Creates a basic authenticator with the given username and password. | |
BasicAuthenticator explicit | Extracts basic authentication credentials from the given request. | |
BasicAuthenticator explicit | Parses a raw Basic authentication payload string. The value can be extracted from a request via [Request::getCredentials()](icy-http-Request.html#getcredentials). | |
~BasicAuthenticator | Destroys the basic authenticator. | |
void | setUsername | Sets the username. |
const std::string & | username const | Returns the username. |
void | setPassword | Sets the password. |
const std::string & | password const | Returns the password. |
void | authenticate const | Adds authentication information to the given http::Request. |
void | proxyAuthenticate const | Adds proxy authentication information to the given http::Request. |
BasicAuthenticator()Creates an empty basic authenticator.
BasicAuthenticator(const std::string & username, const std::string & password)Creates a basic authenticator with the given username and password.
explicit
explicit BasicAuthenticator(const http::Request & request)Extracts basic authentication credentials from the given request.
Throws a NotAuthenticatedException if the request does not contain basic authentication information.
explicit
explicit BasicAuthenticator(const std::string & authInfo)Parses a raw Basic authentication payload string. The value can be extracted from a request via [Request::getCredentials()](icy-http-Request.html#getcredentials).
~BasicAuthenticator()Destroys the basic authenticator.
void setUsername(const std::string & username)Sets the username.
const
const std::string & username() constReturns the username.
void setPassword(const std::string & password)Sets the password.
const
const std::string & password() constReturns the password.
const
void authenticate(http::Request & request) constAdds authentication information to the given http::Request.
const
void proxyAuthenticate(http::Request & request) constAdds proxy authentication information to the given http::Request.
| Return | Name | Description |
|---|---|---|
void | parseAuthInfo | Extracts username and password from Basic authentication info by base64-decoding authInfo and splitting the resulting std::string at the ':' delimiter. |
void parseAuthInfo(std::string_view authInfo)Extracts username and password from Basic authentication info by base64-decoding authInfo and splitting the resulting std::string at the ':' delimiter.
std::string _usernamestd::string _password| Return | Name | Description |
|---|---|---|
BasicAuthenticator | Deleted constructor. |
BasicAuthenticator(const BasicAuthenticator &) = deleteDeleted constructor.