Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.securityfilter.authenticator
Class FormAuthenticator  view FormAuthenticator download FormAuthenticator.java

java.lang.Object
  extended byorg.securityfilter.authenticator.FormAuthenticator
All Implemented Interfaces:
Authenticator

public class FormAuthenticator
extends java.lang.Object
implements Authenticator

FormAuthenticator - authenticator implementation for the FORM auth method.

Version:
$Revision: 1.3 $ $Date: 2003/10/25 12:43:21 $

Field Summary
static java.lang.String DEFAULT_LOGIN_SUBMIT_PATTERN
           
protected  java.lang.String defaultPage
           
protected  java.lang.String errorPage
           
protected  org.securityfilter.filter.URLPattern errorPagePattern
           
protected static java.lang.String FORM_PASSWORD
           
protected static java.lang.String FORM_USERNAME
           
static java.lang.String LOGIN_SUBMIT_PATTERN_KEY
           
protected  java.lang.String loginPage
           
protected  org.securityfilter.filter.URLPattern loginPagePattern
           
protected  java.lang.String loginSubmitPattern
           
protected  org.securityfilter.realm.SecurityRealmInterface realm
           
 
Constructor Summary
FormAuthenticator()
           
 
Method Summary
 boolean bypassSecurityForThisRequest(org.securityfilter.filter.SecurityRequestWrapper request, org.securityfilter.filter.URLPatternMatcher patternMatcher)
          The login and error pages should be viewable, even if they would otherwise be blocked by a security constraint.
 java.lang.String getAuthMethod()
          Returns FORM as the authentication method.
private  java.lang.String getContinueToURL(javax.servlet.http.HttpServletRequest request)
          FormAuthenticator has a special case where the user should be sent to a default page if the user spontaneously submits a login request.
 void init(javax.servlet.FilterConfig filterConfig, org.securityfilter.config.SecurityConfig securityConfig)
          Initilize this Authenticator.
 boolean processLogin(org.securityfilter.filter.SecurityRequestWrapper request, javax.servlet.http.HttpServletResponse response)
          Process any login information that was included in the request, if any.
 void showLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Show the login page.
private  java.lang.String stripQueryString(java.lang.String uri)
          Utility method to strip the query string from a uri.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN_SUBMIT_PATTERN_KEY

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

DEFAULT_LOGIN_SUBMIT_PATTERN

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

loginSubmitPattern

protected java.lang.String loginSubmitPattern

FORM_USERNAME

protected static final java.lang.String FORM_USERNAME
See Also:
Constant Field Values

FORM_PASSWORD

protected static final java.lang.String FORM_PASSWORD
See Also:
Constant Field Values

loginPage

protected java.lang.String loginPage

loginPagePattern

protected org.securityfilter.filter.URLPattern loginPagePattern

errorPage

protected java.lang.String errorPage

errorPagePattern

protected org.securityfilter.filter.URLPattern errorPagePattern

defaultPage

protected java.lang.String defaultPage

realm

protected org.securityfilter.realm.SecurityRealmInterface realm
Constructor Detail

FormAuthenticator

public FormAuthenticator()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig,
                 org.securityfilter.config.SecurityConfig securityConfig)
          throws java.lang.Exception
Initilize this Authenticator.

Specified by:
init in interface Authenticator

getAuthMethod

public java.lang.String getAuthMethod()
Returns FORM as the authentication method.

Specified by:
getAuthMethod in interface Authenticator

processLogin

public boolean processLogin(org.securityfilter.filter.SecurityRequestWrapper request,
                            javax.servlet.http.HttpServletResponse response)
                     throws java.lang.Exception
Process any login information that was included in the request, if any. Returns true if SecurityFilter should abort further processing after the method completes (for example, if a redirect was sent as part of the login processing).

Specified by:
processLogin in interface Authenticator

showLogin

public void showLogin(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws java.io.IOException
Show the login page.

Specified by:
showLogin in interface Authenticator

getContinueToURL

private java.lang.String getContinueToURL(javax.servlet.http.HttpServletRequest request)
FormAuthenticator has a special case where the user should be sent to a default page if the user spontaneously submits a login request.


bypassSecurityForThisRequest

public boolean bypassSecurityForThisRequest(org.securityfilter.filter.SecurityRequestWrapper request,
                                            org.securityfilter.filter.URLPatternMatcher patternMatcher)
                                     throws java.lang.Exception
The login and error pages should be viewable, even if they would otherwise be blocked by a security constraint.

Specified by:
bypassSecurityForThisRequest in interface Authenticator

stripQueryString

private java.lang.String stripQueryString(java.lang.String uri)
Utility method to strip the query string from a uri.