public abstract class MyAuthenticatingFilter extends MyAuthenticationFilter
AuthenticationFilter that is capable of automatically performing an authentication attempt
based on the incoming request.| 限定符和类型 | 字段和说明 |
|---|---|
static String |
PERMISSIVE |
DEFAULT_SUCCESS_URLDEFAULT_LOGIN_URL, GET_METHOD, POST_METHOD| 构造器和说明 |
|---|
MyAuthenticatingFilter() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
cleanup(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
Exception existing)
Overrides the default behavior to call
MyAccessControlFilter.onAccessDenied(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.Object) and swallow the exception if the exception is
UnauthenticatedException. |
protected abstract CaptchaUsernamePasswordToken |
createToken(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
protected CaptchaUsernamePasswordToken |
createToken(String username,
String password,
boolean rememberMe,
String host) |
protected CaptchaUsernamePasswordToken |
createToken(String username,
String password,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
protected CaptchaUsernamePasswordToken |
createToken(String username,
String password,
String captcha,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
protected void |
doCaptchaValidate(CaptchaUsernamePasswordToken token) |
protected boolean |
executeLogin(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
protected String |
getCaptcha(javax.servlet.ServletRequest request) |
protected String |
getHost(javax.servlet.ServletRequest request)
Returns the host name or IP associated with the current subject.
|
protected boolean |
isAccessAllowed(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
Object mappedValue)
Determines whether the current subject should be allowed to make the current request.
|
protected boolean |
isPermissive(Object mappedValue)
Returns
true if the mappedValue contains the PERMISSIVE qualifier. |
protected boolean |
isRememberMe(javax.servlet.ServletRequest request)
Returns
true if "rememberMe" should be enabled for the login attempt associated with the
current request, false otherwise. |
protected boolean |
onLoginFailure(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.authc.AuthenticationException e,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
protected boolean |
onLoginSuccess(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.subject.Subject subject,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
dynaRedirect, getSuccessUrl, getSuccessUrlMap, issueFailureRedirect, issueSuccessRedirect, setSuccessUrl, setSuccessUrlMapgetFailureUrl, getFailureUrlMap, getLoginUrl, getLoginUrlMap, getRealFailureUrl, getRealLoginUrl, getSubject, isLoginRequest, onAccessDenied, onAccessDenied, onPreHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin, setFailureUrl, setFailureUrlMap, setLoginUrl, setLoginUrlMapgetPathWithinApplication, isEnabled, pathsMatch, pathsMatch, preHandle, processPathConfigafterCompletion, doFilterInternal, executeChain, postHandledoFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, setEnabled, shouldNotFilterdestroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfigprotected boolean executeLogin(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws Exception
Exceptionprotected abstract CaptchaUsernamePasswordToken createToken(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws Exception
Exceptionprotected CaptchaUsernamePasswordToken createToken(String username, String password, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
protected CaptchaUsernamePasswordToken createToken(String username, String password, boolean rememberMe, String host)
protected boolean onLoginSuccess(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.subject.Subject subject,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws Exception
Exceptionprotected boolean onLoginFailure(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.authc.AuthenticationException e,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws Exception
Exceptionprotected String getHost(javax.servlet.ServletRequest request)
AuthenticationToken.
The default implementation merely returns ServletRequest.getRemoteHost().request - the incoming ServletRequestInetAddress to associate with the login attempt.protected boolean isRememberMe(javax.servlet.ServletRequest request)
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.request - the incoming ServletRequesttrue if "rememberMe" should be enabled for the login attempt associated with the
current request, false otherwise.protected boolean isAccessAllowed(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
Object mappedValue)
true if the user is authenticated. Will also return
true if the MyAccessControlFilter.isLoginRequest(javax.servlet.ServletRequest, javax.servlet.ServletResponse) returns false and the "permissive" flag is set.isAccessAllowed 在类中 MyAuthenticationFilterrequest - the incoming ServletRequestresponse - the outgoing ServletResponsemappedValue - the filter-specific config value mapped to this filter in the URL rules mappings.true if request should be allowed accessprotected boolean isPermissive(Object mappedValue)
true if the mappedValue contains the PERMISSIVE qualifier.mappedValue - mappedValuetrue if this filter should be permissiveprotected void cleanup(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
Exception existing)
throws javax.servlet.ServletException,
IOException
MyAccessControlFilter.onAccessDenied(javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.Object) and swallow the exception if the exception is
UnauthenticatedException.cleanup 在类中 org.apache.shiro.web.servlet.AdviceFilterjavax.servlet.ServletExceptionIOExceptionprotected String getCaptcha(javax.servlet.ServletRequest request)
protected CaptchaUsernamePasswordToken createToken(String username, String password, String captcha, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
protected void doCaptchaValidate(CaptchaUsernamePasswordToken token)
Copyright © 2014. All rights reserved.