"http-port": 8000,
"basic-authentication-realm": "kea-control-agent",
- // In basoc HTTP authentication
+ // In basic HTTP authentication
"basic-authentications":
[
{
comment to be attached within the configuration itself.
The basic HTTP authentication was added by Kea 1.7.10. It protects
-not authorized uses of the control agent by local users. For the
+against not authorized uses of the control agent by local users. For the
protection against remote attackers HTTPS and reverse proxy of
:ref:`agent-secure-connection` provide a stronger security.
return (basic_auth_);
}
- /// @brief Adds a basic HTTP authentication header to a request.
+ /// @brief Adds a basic HTTP authentication header to a request
+ /// when credentials are specified.
void addBasicAuthHttpHeader(http::PostHttpRequestJsonPtr request) const;
private:
/// @brief Build the credential from the secret.
void buildCredential();
- /// @brief User id.
+ /// @brief User id e.g. johndoe.
std::string user_;
- /// @brief Password.
+ /// @brief Password e.g. secret1.
std::string password_;
- /// @brief Secret.
+ /// @brief Secret e.g. johndoe:secret1.
std::string secret_;
- /// @brief Credential.
+ /// @brief Credential: base64 encoding of UTF-8 secret,
+ /// e.g. am9obmRvZTpzZWNyZXQx.
std::string credential_;
};
% HTTP_CLIENT_REQUEST_NOT_AUTHORIZED received HTTP request with not matching authentication header
This information message is issued when the server receives a request with
-authentication header carrying not recognized credential.
+authentication header carrying not recognized credential: the user
+provided incorrect user id and/or password.
% HTTP_CLIENT_REQUEST_NO_AUTH_HEADER received HTTP request without required authentication header
This information message is issued when the server receives a request without
///
/// @param creator The HTTP response creator.
/// @param request The HTTP request to validate.
-/// @param credentials Authorized credentials and user id map.
+/// @param credentials A map of all allowed credentials.
/// @param realm Realm name.
/// @return Error HTTP response if validation failed, null otherwise.
HttpResponseJsonPtr checkBasicHttpAuth(const HttpResponseCreator& creator,