com.caucho.server.security
Class FormLogin

java.lang.Object
  extended by com.caucho.server.security.AbstractLogin
      extended by com.caucho.server.security.FormLogin
All Implemented Interfaces:
LoginFilter

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
           
protected  java.lang.String _loginPage
           
static java.lang.String LOGIN_SAVED_PATH
           
static java.lang.String LOGIN_SAVED_QUERY
           
 
Fields inherited from class com.caucho.server.security.AbstractLogin
_auth, log
 
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 setErrorPage(java.lang.String errorPage)
           
 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.
 void setLoginPage(java.lang.String loginPage)
           
 
Methods inherited from class com.caucho.server.security.AbstractLogin
getAuthenticator, getUserPrincipal, isUserInRole, logout, setAuthenticator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGIN_SAVED_PATH

public static final java.lang.String LOGIN_SAVED_PATH
See Also:
Constant Field Values

LOGIN_SAVED_QUERY

public static final java.lang.String LOGIN_SAVED_QUERY
See Also:
Constant Field Values

_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)
                      throws ConfigException
Sets the login page.

Throws:
ConfigException

setLoginPage

public void setLoginPage(java.lang.String loginPage)

getFormLoginPage

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


setFormErrorPage

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

Throws:
ConfigException

setErrorPage

public void setErrorPage(java.lang.String errorPage)

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
Throws:
ServletException

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.
Throws:
ServletException
java.io.IOException