Neokernel API

HTTPAuthenticationAgent Class

This agent is used by the WebServer to handle authorization of password protected resources.

The authentication file defines the realms and the usernames and passwords which are used to authenticate clients to the paths associated with each realm. The authentication file is delimited by newlines and must end with a newline. Each realm is declared with a PATH and the REALM name separated by spaces, followed by usernames and passwords on new lines, separated by a space. PATHs must begin with a slash and end with a slash.

The HOSTNAME field at the beginning of the file indicates to the HTTPAuthentication agent what hostname the realms should be mapped to. In Virtual Host (multihoming) configurations, use multiple authentication files with different HOSTNAME values for each file. The default hostname is default.

Here is an example authentication file:
HOSTNAME
PATH0 REALM0
username0 password0
username1 password1
username2 password2
username3 password3
PATH1 REALM2
username0 password0
username1 password1

The following example shows an example of an authentication file with two realms, 'My realm' and 'Main Realm'. If any access is made to files or directories in /private/, this agent will ask for the username jonlin with the password mainpassword, except for accesses to /private/mine/, which is under the /private/ path but is its own realm and requires its own usernames and passwords. If default is used as the hostname then the authentication map will apply to all virtual hosts on this server.

default
/private/mine/ My realm
john johnpassword
santos halper
/private/ Main Realm
john mainpassword
This agent supports the following Props settings:
service_name
The name this agent uses to register with Service Manager. The WebServer's authentication_agent prop must be set to match this agent's service_name, or requests for urls requiring authentication will not be handed off to this agent. The default value is http_authentication.agent.
authentication_files
The file(s) used for authenticating requests. The default value is ./http.authentication. Separate multiple files with commas.

For a list of all members of this type, see HTTPAuthenticationAgent Members .

System.Object
   Props
      Agent
         ServiceAgent
            RequestAgent
               HTTPAuthenticationAgent

public class HTTPAuthenticationAgent : RequestAgent

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: com.neokernel.httpd

Assembly: Neokernel (in Neokernel.exe)

See Also

HTTPAuthenticationAgent Members | com.neokernel.httpd Namespace