org.melati.login
Class HttpBasicAuthenticationAccessHandler

Package class diagram package HttpBasicAuthenticationAccessHandler
java.lang.Object
  extended by org.melati.login.HttpBasicAuthenticationAccessHandler
All Implemented Interfaces:
AccessHandler

public class HttpBasicAuthenticationAccessHandler
extends Object
implements AccessHandler

An AccessHandler which uses the HTTP Basic Authentication scheme to elicit and maintain the user's login and password. This implementation doesn't use the servlet session at all, so it doesn't try to send cookies or do URL rewriting.


Constructor Summary
HttpBasicAuthenticationAccessHandler()
           
 
Method Summary
 void buildRequest(Melati melati)
          If we are allowed in then no need to change request.
 Melati establishUser(Melati melati)
          Get the users details.
protected  void forceLogin(javax.servlet.http.HttpServletResponse resp, String realm, String message)
          Force a login by sending a 401 error back to the browser.
 void handleAccessException(Melati melati, AccessPoemException accessException)
          Called when an AccessPoemException is trapped.
protected  boolean useSession()
          Change here to use session, if that makes sense.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpBasicAuthenticationAccessHandler

public HttpBasicAuthenticationAccessHandler()
Method Detail

useSession

protected boolean useSession()
Change here to use session, if that makes sense.

Returns:
false

forceLogin

protected void forceLogin(javax.servlet.http.HttpServletResponse resp,
                          String realm,
                          String message)
Force a login by sending a 401 error back to the browser. HACK Apache/Netscape appear not to do anything with message, which is why it's just left as a String.


handleAccessException

public void handleAccessException(Melati melati,
                                  AccessPoemException accessException)
                           throws Exception
Called when an AccessPoemException is trapped.

Specified by:
handleAccessException in interface AccessHandler
Parameters:
melati - the Melati
accessException - the particular access exception to handle the AccessException
Throws:
Exception
See Also:
handleAccessException(org.melati.Melati, org.melati.poem.AccessPoemException)

establishUser

public Melati establishUser(Melati melati)
Get the users details. Called when a @link PoemTask} is initiated.

Specified by:
establishUser in interface AccessHandler
Returns:
A Melati with the appropriate fields filled.
See Also:
AccessHandler.establishUser(org.melati.Melati)

buildRequest

public void buildRequest(Melati melati)
                  throws IOException
If we are allowed in then no need to change request. Rebuild request if we have had to login, otherwise nothing.

Specified by:
buildRequest in interface AccessHandler
Parameters:
melati - used to hold original request
Throws:
IOException
See Also:
AccessHandler.buildRequest(org.melati.Melati)


Copyright © 2000-2010 PanEris. All Rights Reserved.