Authenticator
Authenticator
#include <icy/http/authenticator.h>class AuthenticatorDefined in src/http/include/icy/http/authenticator.h:32
Maintains HTTP Basic or Digest authentication state for outbound requests.
Note: Do not forget to read the entire response stream from the 401 response before sending the authenticated request, otherwise there may be problems if a persistent connection is used.
List of all members
| Name | Kind | Owner |
|---|---|---|
Authenticator | function | Declared here |
Authenticator | function | Declared here |
~Authenticator | function | Declared here |
fromUserInfo | function | Declared here |
fromURI | function | Declared here |
setUsername | function | Declared here |
username | function | Declared here |
setPassword | function | Declared here |
password | function | Declared here |
authenticate | function | Declared here |
updateAuthInfo | function | Declared here |
proxyAuthenticate | function | Declared here |
updateProxyAuthInfo | function | Declared here |
_username | variable | Declared here |
_password | variable | Declared here |
Authenticator | function | Declared here |
operator= | function | Declared here |
Public Methods
| Return | Name | Description |
|---|---|---|
Authenticator | Creates an empty authenticator. | |
Authenticator | Creates an authenticator with the given username and password. | |
~Authenticator | Destroys the authenticator. | |
void | fromUserInfo | Parses username:password std::string and sets username and password of the credentials object. Throws SyntaxException on invalid user information. |
void | fromURI | Extracts username and password from the given URI and sets username and password of the credentials object. Does nothing if URI has no user info part. |
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 | Inspects WWW-Authenticate header of the response, initializes the internal state (in case of digest authentication) and adds required information to the given http::Request. |
void | updateAuthInfo | Updates internal state (in case of digest authentication) and replaces authentication information in the request accordingly. |
void | proxyAuthenticate | Inspects Proxy-Authenticate header of the response, initializes the internal state (in case of digest authentication) and adds required information to the given http::Request. |
void | updateProxyAuthInfo | Updates internal state (in case of digest authentication) and replaces proxy authentication information in the request accordingly. |
Authenticator
Authenticator()Defined in src/http/include/icy/http/authenticator.h:36
Creates an empty authenticator.
Authenticator
Authenticator(const std::string & username, const std::string & password)Defined in src/http/include/icy/http/authenticator.h:39
Creates an authenticator with the given username and password.
~Authenticator
~Authenticator()Defined in src/http/include/icy/http/authenticator.h:42
Destroys the authenticator.
fromUserInfo
void fromUserInfo(std::string_view userInfo)Defined in src/http/include/icy/http/authenticator.h:47
Parses username:password std::string and sets username and password of the credentials object. Throws SyntaxException on invalid user information.
fromURI
void fromURI(const http::URL & uri)Defined in src/http/include/icy/http/authenticator.h:52
Extracts username and password from the given URI and sets username and password of the credentials object. Does nothing if URI has no user info part.
setUsername
void setUsername(const std::string & username)Defined in src/http/include/icy/http/authenticator.h:55
Sets the username.
username
const
const std::string & username() constDefined in src/http/include/icy/http/authenticator.h:58
Returns the username.
setPassword
void setPassword(const std::string & password)Defined in src/http/include/icy/http/authenticator.h:61
Sets the password.
password
const
const std::string & password() constDefined in src/http/include/icy/http/authenticator.h:64
Returns the password.
authenticate
void authenticate(http::Request & request, const http::Response & response)Defined in src/http/include/icy/http/authenticator.h:69
Inspects WWW-Authenticate header of the response, initializes the internal state (in case of digest authentication) and adds required information to the given http::Request.
updateAuthInfo
void updateAuthInfo(http::Request & request)Defined in src/http/include/icy/http/authenticator.h:73
Updates internal state (in case of digest authentication) and replaces authentication information in the request accordingly.
proxyAuthenticate
void proxyAuthenticate(http::Request & request, const http::Response & response)Defined in src/http/include/icy/http/authenticator.h:78
Inspects Proxy-Authenticate header of the response, initializes the internal state (in case of digest authentication) and adds required information to the given http::Request.
updateProxyAuthInfo
void updateProxyAuthInfo(http::Request & request)Defined in src/http/include/icy/http/authenticator.h:83
Updates internal state (in case of digest authentication) and replaces proxy authentication information in the request accordingly.
Private Attributes
_username
std::string _usernameDefined in src/http/include/icy/http/authenticator.h:89
_password
std::string _passwordDefined in src/http/include/icy/http/authenticator.h:90
Private Methods
| Return | Name | Description |
|---|---|---|
Authenticator | Deleted constructor. |
Authenticator
Authenticator(const Authenticator &) = deleteDefined in src/http/include/icy/http/authenticator.h:86
Deleted constructor.
