|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.apache.shiro.web.servlet.ServletContextSupport
org.apache.shiro.web.servlet.AbstractFilter
org.apache.shiro.web.servlet.NameableFilter
org.apache.shiro.web.servlet.OncePerRequestFilter
org.apache.shiro.web.servlet.AdviceFilter
org.apache.shiro.web.filter.PathMatchingFilter
org.apache.shiro.web.filter.AccessControlFilter
org.apache.shiro.web.filter.authc.AuthenticationFilter
org.apache.shiro.web.filter.authc.AuthenticatingFilter
org.apache.shiro.web.filter.authc.FormAuthenticationFilter
com.github.dactiv.showcase.service.account.CaptchaAuthenticationFilter
@Component public class CaptchaAuthenticationFilter
验证码登录认证Filter
| 字段摘要 | |
|---|---|
static String |
DEFAULT_CAPTCHA_PARAM
默认验证码参数名称 |
| 从类 org.apache.shiro.web.filter.authc.FormAuthenticationFilter 继承的字段 |
|---|
DEFAULT_ERROR_KEY_ATTRIBUTE_NAME, DEFAULT_PASSWORD_PARAM, DEFAULT_REMEMBER_ME_PARAM, DEFAULT_USERNAME_PARAM |
| 从类 org.apache.shiro.web.filter.authc.AuthenticatingFilter 继承的字段 |
|---|
PERMISSIVE |
| 从类 org.apache.shiro.web.filter.authc.AuthenticationFilter 继承的字段 |
|---|
DEFAULT_SUCCESS_URL |
| 从类 org.apache.shiro.web.filter.AccessControlFilter 继承的字段 |
|---|
DEFAULT_LOGIN_URL, GET_METHOD, POST_METHOD |
| 从类 org.apache.shiro.web.filter.PathMatchingFilter 继承的字段 |
|---|
appliedPaths, pathMatcher |
| 从类 org.apache.shiro.web.servlet.OncePerRequestFilter 继承的字段 |
|---|
ALREADY_FILTERED_SUFFIX |
| 从类 org.apache.shiro.web.servlet.AbstractFilter 继承的字段 |
|---|
filterConfig |
| 构造方法摘要 | |
|---|---|
CaptchaAuthenticationFilter()
|
|
| 方法摘要 | |
|---|---|
protected boolean |
executeLogin(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
重写父类方法,在shiro执行登录时先对比验证码,正确后在登录,否则直接登录失败 |
Integer |
getAllowIncorrectNumber()
获取允许登录次数 |
String |
getCaptcha(javax.servlet.ServletRequest request)
获取用户输入的验证码 |
String |
getCaptchaParam()
获取验证码提交的参数名称 |
String |
getLoginIncorrectNumberKeyAttribute()
获取登录错误次数的key属性名称 |
String |
getSessionCaptchaKeyAttribute()
获取设置在session中的存储验证码的key名称 |
protected boolean |
onLoginFailure(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.authc.AuthenticationException e,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
重写父类方法,当登录失败后,将allowIncorrectNumber(允许登错误录次) + 1 |
protected boolean |
onLoginSuccess(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.subject.Subject subject,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
重写父类方法,当登录成功后,将allowIncorrectNumber(允许登错误录次)设置为0,重置下一次登录的状态 |
void |
setAllowIncorrectNumber(Integer allowIncorrectNumber)
设置允许登录次数,当登录次数大于该数值时,会在页面中显示验证码 |
void |
setCaptchaParam(String captchaParam)
设置验证码提交的参数名称 |
protected void |
setFailureAttribute(javax.servlet.ServletRequest request,
org.apache.shiro.authc.AuthenticationException ae)
重写父类方法,当登录失败将异常信息设置到request的attribute中 |
void |
setLoginIncorrectNumberKeyAttribute(String loginIncorrectNumberKeyAttribute)
设置登录错误次数的key属性名称 |
void |
setSessionCaptchaKeyAttribute(String sessionCaptchaKeyAttribute)
设置在session中的存储验证码的key名称 |
| 从类 org.apache.shiro.web.filter.authc.FormAuthenticationFilter 继承的方法 |
|---|
createToken, getFailureKeyAttribute, getPassword, getPasswordParam, getRememberMeParam, getUsername, getUsernameParam, isLoginSubmission, isRememberMe, onAccessDenied, setFailureKeyAttribute, setLoginUrl, setPasswordParam, setRememberMeParam, setUsernameParam |
| 从类 org.apache.shiro.web.filter.authc.AuthenticatingFilter 继承的方法 |
|---|
cleanup, createToken, createToken, getHost, isAccessAllowed, isPermissive |
| 从类 org.apache.shiro.web.filter.authc.AuthenticationFilter 继承的方法 |
|---|
getSuccessUrl, issueSuccessRedirect, setSuccessUrl |
| 从类 org.apache.shiro.web.filter.AccessControlFilter 继承的方法 |
|---|
getLoginUrl, getSubject, isLoginRequest, onAccessDenied, onPreHandle, redirectToLogin, saveRequest, saveRequestAndRedirectToLogin |
| 从类 org.apache.shiro.web.filter.PathMatchingFilter 继承的方法 |
|---|
getPathWithinApplication, isEnabled, pathsMatch, pathsMatch, preHandle, processPathConfig |
| 从类 org.apache.shiro.web.servlet.AdviceFilter 继承的方法 |
|---|
afterCompletion, doFilterInternal, executeChain, postHandle |
| 从类 org.apache.shiro.web.servlet.OncePerRequestFilter 继承的方法 |
|---|
doFilter, getAlreadyFilteredAttributeName, isEnabled, isEnabled, setEnabled, shouldNotFilter |
| 从类 org.apache.shiro.web.servlet.NameableFilter 继承的方法 |
|---|
getName, setName, toStringBuilder |
| 从类 org.apache.shiro.web.servlet.AbstractFilter 继承的方法 |
|---|
destroy, getFilterConfig, getInitParam, init, onFilterConfigSet, setFilterConfig |
| 从类 org.apache.shiro.web.servlet.ServletContextSupport 继承的方法 |
|---|
getContextAttribute, getContextInitParam, getServletContext, removeContextAttribute, setContextAttribute, setServletContext, toString |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 字段详细信息 |
|---|
public static final String DEFAULT_CAPTCHA_PARAM
| 构造方法详细信息 |
|---|
public CaptchaAuthenticationFilter()
| 方法详细信息 |
|---|
protected boolean executeLogin(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws Exception
org.apache.shiro.web.filter.authc.AuthenticatingFilter 中的 executeLoginException
protected void setFailureAttribute(javax.servlet.ServletRequest request,
org.apache.shiro.authc.AuthenticationException ae)
org.apache.shiro.web.filter.authc.FormAuthenticationFilter 中的 setFailureAttribute
protected boolean onLoginFailure(org.apache.shiro.authc.AuthenticationToken token,
org.apache.shiro.authc.AuthenticationException e,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
org.apache.shiro.web.filter.authc.FormAuthenticationFilter 中的 onLoginFailure
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
org.apache.shiro.web.filter.authc.FormAuthenticationFilter 中的 onLoginSuccessExceptionpublic void setCaptchaParam(String captchaParam)
captchaParam - 验证码提交的参数名称public String getCaptchaParam()
public void setSessionCaptchaKeyAttribute(String sessionCaptchaKeyAttribute)
sessionCaptchaKeyAttribute - 存储验证码的key名称public String getSessionCaptchaKeyAttribute()
public String getLoginIncorrectNumberKeyAttribute()
public void setLoginIncorrectNumberKeyAttribute(String loginIncorrectNumberKeyAttribute)
loginIncorrectNumberKeyAttribute - 属性名称public String getCaptcha(javax.servlet.ServletRequest request)
request - ServletRequest
public Integer getAllowIncorrectNumber()
public void setAllowIncorrectNumber(Integer allowIncorrectNumber)
allowIncorrectNumber - 允许登录次数
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||