return new CaptchaUsernamePasswordToken(username, password, rememberMe, host, captcha);
}
// 验证码校验
protected void doCaptchaValidate(CaptchaUsernamePasswordToken token) {
Session session = SecurityUtils.getSubject().getSession();
if (session == null) {
throw new UnknownSessionException("Unable found required Session");
} else {
if (session.getAttribute(DEFAULT_CAPTCHA_PARAM) != null) {
String captcha = session.getAttribute(DEFAULT_CAPTCHA_PARAM).toString();
// String captcha = CookieUtils.getCookie(request, AppConstants.CAPTCHA_NAME);
if (token.getCaptcha() != null &&
captcha.equalsIgnoreCase(EncriptionUtils.encrypt(token.getCaptcha()))) {
return;
}