BasicAuthenticator
BasicAuthenticator
#include <icy/http/authenticator.h>class BasicAuthenticatorDefined in src/http/include/icy/http/authenticator.h:99
Encodes and decodes HTTP Basic authentication credentials.
List of all members
| Name | Kind | Owner |
|---|---|---|
BasicAuthenticator | function | Declared here |
BasicAuthenticator | function | Declared here |
BasicAuthenticator | function | Declared here |
BasicAuthenticator | function | Declared here |
~BasicAuthenticator | function | Declared here |
setUsername | function | Declared here |
username | function | Declared here |
setPassword | function | Declared here |
password | function | Declared here |
authenticate | function | Declared here |
proxyAuthenticate | function | Declared here |
parseAuthInfo | function | Declared here |
_username | variable | Declared here |
_password | variable | Declared here |
BasicAuthenticator | function | Declared here |
operator= | function | Declared here |
Public Methods
| 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
BasicAuthenticator()Defined in src/http/include/icy/http/authenticator.h:103
Creates an empty basic authenticator.
BasicAuthenticator
BasicAuthenticator(const std::string & username, const std::string & password)Defined in src/http/include/icy/http/authenticator.h:106
Creates a basic authenticator with the given username and password.
BasicAuthenticator
explicit
explicit BasicAuthenticator(const http::Request & request)Defined in src/http/include/icy/http/authenticator.h:113
Extracts basic authentication credentials from the given request.
Throws a NotAuthenticatedException if the request does not contain basic authentication information.
BasicAuthenticator
explicit
explicit BasicAuthenticator(const std::string & authInfo)Defined in src/http/include/icy/http/authenticator.h:117
Parses a raw Basic authentication payload string. The value can be extracted from a request via [Request::getCredentials()](icy-http-Request.html#getcredentials).
~BasicAuthenticator
~BasicAuthenticator()Defined in src/http/include/icy/http/authenticator.h:120
Destroys the basic authenticator.
setUsername
void setUsername(const std::string & username)Defined in src/http/include/icy/http/authenticator.h:123
Sets the username.
username
const
const std::string & username() constDefined in src/http/include/icy/http/authenticator.h:126
Returns the username.
setPassword
void setPassword(const std::string & password)Defined in src/http/include/icy/http/authenticator.h:129
Sets the password.
password
const
const std::string & password() constDefined in src/http/include/icy/http/authenticator.h:132
Returns the password.
authenticate
const
void authenticate(http::Request & request) constDefined in src/http/include/icy/http/authenticator.h:135
Adds authentication information to the given http::Request.
proxyAuthenticate
const
void proxyAuthenticate(http::Request & request) constDefined in src/http/include/icy/http/authenticator.h:138
Adds proxy authentication information to the given http::Request.
Protected Methods
| 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. |
parseAuthInfo
void parseAuthInfo(std::string_view authInfo)Defined in src/http/include/icy/http/authenticator.h:144
Extracts username and password from Basic authentication info by base64-decoding authInfo and splitting the resulting std::string at the ':' delimiter.
Private Attributes
_username
std::string _usernameDefined in src/http/include/icy/http/authenticator.h:150
_password
std::string _passwordDefined in src/http/include/icy/http/authenticator.h:151
Private Methods
| Return | Name | Description |
|---|---|---|
BasicAuthenticator | Deleted constructor. |
BasicAuthenticator
BasicAuthenticator(const BasicAuthenticator &) = deleteDefined in src/http/include/icy/http/authenticator.h:147
Deleted constructor.
