org.apache.jcs.utils.servlet
Class BasicHttpAuthenticator

java.lang.Object
  extended byorg.apache.jcs.utils.servlet.BasicHttpAuthenticator

public class BasicHttpAuthenticator
extends java.lang.Object

Used to perform basic http authentication.

Author:
asmuts

Field Summary
private static org.apache.commons.logging.Log log
           
private  java.lang.String wwwAuthHeader
          Contains the "WWW-Authenticate" http response header.
 
Constructor Summary
BasicHttpAuthenticator(java.lang.String jcs)
           
 
Method Summary
 boolean authenticate(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Authenticates the http "Authorization" header information.
private  boolean authorized(java.lang.String authHeader)
          Returns true iff the given "Authorization" http request header contains authorized user id and password.
protected  boolean checkPassword(java.lang.String userid, java.lang.String password)
          Default implementation of checking the password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

wwwAuthHeader

private final java.lang.String wwwAuthHeader
Contains the "WWW-Authenticate" http response header.

Constructor Detail

BasicHttpAuthenticator

public BasicHttpAuthenticator(java.lang.String jcs)
Parameters:
jcs - the jcs parameter used to specify the "WWW-Authenticate" http response header.
Method Detail

authenticate

public final boolean authenticate(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse res)
Authenticates the http "Authorization" header information.


authorized

private boolean authorized(java.lang.String authHeader)
                    throws java.io.IOException
Returns true iff the given "Authorization" http request header contains authorized user id and password.

Throws:
java.io.IOException

checkPassword

protected boolean checkPassword(java.lang.String userid,
                                java.lang.String password)
Default implementation of checking the password.

Returns:
true iff the given user id and password is valid.