org.jsecurity.web.filter.authc
Class AuthenticatingFilter
java.lang.Object
org.jsecurity.web.servlet.ServletContextSupport
org.jsecurity.web.servlet.OncePerRequestFilter
org.jsecurity.web.servlet.AdviceFilter
org.jsecurity.web.filter.PathMatchingFilter
org.jsecurity.web.filter.AccessControlFilter
org.jsecurity.web.filter.authc.AuthenticationFilter
org.jsecurity.web.filter.authc.AuthenticatingFilter
- All Implemented Interfaces:
- Filter, Nameable, PathConfigProcessor
- Direct Known Subclasses:
- BasicHttpAuthenticationFilter, FormAuthenticationFilter
public abstract class AuthenticatingFilter
- extends AuthenticationFilter
An AuthenticationFilter that is capable of automatically performing an authentication attempt
based on the incoming request.
- Since:
- 0.9
- Author:
- Les Hazlewood
|
Method Summary |
protected abstract AuthenticationToken |
createToken(ServletRequest request,
ServletResponse response)
|
protected AuthenticationToken |
createToken(String username,
String password,
boolean rememberMe,
InetAddress inet)
|
protected AuthenticationToken |
createToken(String username,
String password,
ServletRequest request,
ServletResponse response)
|
protected boolean |
executeLogin(ServletRequest request,
ServletResponse response)
|
protected InetAddress |
getInetAddress(ServletRequest request)
Returns the InetAddress associated with the current subject. |
protected boolean |
isRememberMe(ServletRequest request)
Returns true if "rememberMe" should be enabled for the login attempt associated with the
current request, false otherwise. |
protected boolean |
onLoginFailure(AuthenticationToken token,
AuthenticationException e,
ServletRequest request,
ServletResponse response)
|
protected boolean |
onLoginSuccess(AuthenticationToken token,
Subject subject,
ServletRequest request,
ServletResponse response)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthenticatingFilter
public AuthenticatingFilter()
executeLogin
protected boolean executeLogin(ServletRequest request,
ServletResponse response)
throws Exception
- Throws:
Exception
createToken
protected abstract AuthenticationToken createToken(ServletRequest request,
ServletResponse response)
throws Exception
- Throws:
Exception
createToken
protected AuthenticationToken createToken(String username,
String password,
ServletRequest request,
ServletResponse response)
createToken
protected AuthenticationToken createToken(String username,
String password,
boolean rememberMe,
InetAddress inet)
onLoginSuccess
protected boolean onLoginSuccess(AuthenticationToken token,
Subject subject,
ServletRequest request,
ServletResponse response)
throws Exception
- Throws:
Exception
onLoginFailure
protected boolean onLoginFailure(AuthenticationToken token,
AuthenticationException e,
ServletRequest request,
ServletResponse response)
getInetAddress
protected InetAddress getInetAddress(ServletRequest request)
- Returns the InetAddress associated with the current subject. This method is primarily provided for use
during construction of an
AuthenticationToken.
The default implementation merely returns
WebUtils.getInetAddress(request).
- Parameters:
request - the incoming ServletRequest
- Returns:
- the
InetAddress to associate with the login attempt.
isRememberMe
protected boolean isRememberMe(ServletRequest request)
- Returns
true if "rememberMe" should be enabled for the login attempt associated with the
current request, false otherwise.
This implementation always returns false and is provided as a template hook to subclasses that
support rememberMe logins and wish to determine rememberMe in a custom mannner
based on the current request.
- Parameters:
request - the incoming ServletRequest
- Returns:
true if "rememberMe" should be enabled for the login attempt associated with the
current request, false otherwise.
Copyright © 2004-2008 JSecurity.