com.caucho.http.security
Class FormLogin

java.lang.Object
  |
  +--com.caucho.http.security.AbstractLogin
        |
        +--com.caucho.http.security.FormLogin

public class FormLogin
extends AbstractLogin

Used to authenticate users in a servlet request. Applications will implement the Authenticator interface with a bean for authentication.

Since:
Resin 2.0.2

Field Summary
protected  java.lang.String errorPage
           
protected  boolean formURIPriority
           
protected  boolean internalForward
           
static java.lang.String LOGIN_SAVED_PATH
           
static java.lang.String LOGIN_SAVED_QUERY
           
protected  java.lang.String loginPage
           
 
Fields inherited from class com.caucho.http.security.AbstractLogin
auth, dbg
 
Constructor Summary
FormLogin()
           
 
Method Summary
 java.security.Principal authenticate(HttpServletRequest request, HttpServletResponse response, ServletContext application)
          Logs a user in with a user name and a password.
 java.lang.String getAuthType()
          Returns the authentication type.
 java.lang.String getFormErrorPage()
          Gets the error page.
 java.lang.String getFormLoginPage()
          Gets the login page.
 boolean getFormURIPriority()
          Returns true if the form's j_uri has priority over the saved URL.
 boolean getInternalForward()
          Returns true if a successful login allows an internal forward instead of a redirect.
 void init()
          Initialize
 void setFormErrorPage(java.lang.String formErrorPage)
          Sets the error page.
 void setFormLoginPage(java.lang.String formLoginPage)
          Sets the login page.
 void setFormURIPriority(boolean formPriority)
          True if the form's j_uri has priority over the saved URL.
 void setInternalForward(boolean internalForward)
          Set true if a successful login allows an internal forward instead of a redirect.
 
Methods inherited from class com.caucho.http.security.AbstractLogin
getAuthenticator, getUserPrincipal, isUserInRole, logout, setAuthenticator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN_SAVED_PATH

public static final java.lang.String LOGIN_SAVED_PATH

LOGIN_SAVED_QUERY

public static final java.lang.String LOGIN_SAVED_QUERY

loginPage

protected java.lang.String loginPage

errorPage

protected java.lang.String errorPage

internalForward

protected boolean internalForward

formURIPriority

protected boolean formURIPriority
Constructor Detail

FormLogin

public FormLogin()
Method Detail

setFormLoginPage

public void setFormLoginPage(java.lang.String formLoginPage)
Sets the login page.

getFormLoginPage

public java.lang.String getFormLoginPage()
Gets the login page.

setFormErrorPage

public void setFormErrorPage(java.lang.String formErrorPage)
Sets the error page.

getFormErrorPage

public java.lang.String getFormErrorPage()
Gets the error page.

getInternalForward

public boolean getInternalForward()
Returns true if a successful login allows an internal forward instead of a redirect.

setInternalForward

public void setInternalForward(boolean internalForward)
Set true if a successful login allows an internal forward instead of a redirect.

getFormURIPriority

public boolean getFormURIPriority()
Returns true if the form's j_uri has priority over the saved URL.

setFormURIPriority

public void setFormURIPriority(boolean formPriority)
True if the form's j_uri has priority over the saved URL.

init

public void init()
          throws ServletException
Initialize
Overrides:
init in class AbstractLogin

getAuthType

public java.lang.String getAuthType()
Returns the authentication type.
Overrides:
getAuthType in class AbstractLogin

authenticate

public java.security.Principal authenticate(HttpServletRequest request,
                                            HttpServletResponse response,
                                            ServletContext application)
                                     throws ServletException,
                                            java.io.IOException
Logs a user in with a user name and a password.
Overrides:
authenticate in class AbstractLogin
Parameters:
request - servlet request
response - servlet response, in case any cookie need sending.
application - servlet application
Returns:
the logged in principal on success, null on failure.