com.mortbay.HTTP.Handler
Class BasicAuthHandler

java.lang.Object
  |
  +--com.mortbay.HTTP.Handler.NullHandler
        |
        +--com.mortbay.HTTP.Handler.BasicAuthHandler

public class BasicAuthHandler
extends NullHandler

Basic Authentication HttpHandler

If the request is for a path with basic authentication, then the request is examined for either existing authentication (in which case the remoteUser is set and the request passed through ) or a basic authentication challenge is sent.

Version:
$Id: BasicAuthHandler.java,v 2.6 2000/05/15 18:04:01 gregw Exp $
Author:
Greg Wilkins
See Also:
Interface.HttpHandler

Fields inherited from class com.mortbay.HTTP.Handler.NullHandler
httpServer
 
Constructor Summary
BasicAuthHandler(PathMap realms)
          Construct basic auth handler.
BasicAuthHandler(java.util.Properties properties)
          Construct basic auth handler.
 
Method Summary
 void handle(HttpRequest request, HttpResponse response)
          Constructor
 void setProperties(java.util.Properties properties)
          Configure from Properties.
 
Methods inherited from class com.mortbay.HTTP.Handler.NullHandler
destroy, getProperties, servlet, servletNames, setServer, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAuthHandler

public BasicAuthHandler(java.util.Properties properties)
                 throws java.io.IOException
Construct basic auth handler.
Parameters:
properties - Passed to setProperties

BasicAuthHandler

public BasicAuthHandler(PathMap realms)
Construct basic auth handler.
Parameters:
realms - PathMap of path to BasicAuthRealm instances which map username to password.
Method Detail

setProperties

public void setProperties(java.util.Properties properties)
                   throws java.io.IOException
Configure from Properties. Properties are assumed to be in the format of a PropertyTree like:
 name.LABEL : The realm label
 name.PATHS : /pathMap/entry;/list
 name.PROPERTIES : fileNameOfLoginPasswordMapping
 name.PROPERTY.login : password
Overrides:
setProperties in class NullHandler
Parameters:
properties - Configuration.

handle

public void handle(HttpRequest request,
                   HttpResponse response)
            throws java.lang.Exception
Description copied from interface: HttpHandler
Constructor
Overrides:
handle in class NullHandler
Tags copied from interface: HttpHandler
Parameters:
request - The HTTP requests to be handled
response - The HTTP response to be used.