| 1282 | namespace { |
| 1283 | |
| 1284 | Result<process::http::authentication::Authenticator*> createBasicAuthenticator( |
| 1285 | const string& realm, |
| 1286 | const string& authenticatorName, |
| 1287 | const Option<Credentials>& credentials) |
| 1288 | { |
| 1289 | if (credentials.isNone()) { |
| 1290 | return Error( |
| 1291 | "No credentials provided for the default '" + |
| 1292 | string(internal::DEFAULT_BASIC_HTTP_AUTHENTICATOR) + |
| 1293 | "' HTTP authenticator for realm '" + realm + "'"); |
| 1294 | } |
| 1295 | |
| 1296 | LOG(INFO) << "Creating default '" |
| 1297 | << internal::DEFAULT_BASIC_HTTP_AUTHENTICATOR |
| 1298 | << "' HTTP authenticator for realm '" << realm << "'"; |
| 1299 | |
| 1300 | return BasicAuthenticatorFactory::create(realm, credentials.get()); |
| 1301 | } |
| 1302 | |
| 1303 | |
| 1304 | #ifdef USE_SSL_SOCKET |