-
shiro不同客户端登录的配置问题
2015-07-27 12:16@DASHU 自己定义了一个 filter
public class MobileFormAuthenticationFilter extends org.apache.shiro.web.filter.authc.AuthenticatingFilter { protected AuthenticationToken createToken(ServletRequest request, ServletResponse response) { String username = request.getParameter("username"); String password = request.getParameter("password"); if (password==null){ password = ""; } boolean rememberMe = isRememberMe(request); String host = StringUtils.getRemoteAddr((HttpServletRequest)request); return new UsernamePasswordToken(username, password.toCharArray(), rememberMe, host, null, false); } @Override protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) { return true; } @Override protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { return executeLogin(request, response); }
}
-
shiro不同客户端登录的配置问题
2015-07-24 14:52@88250 部分逻辑不一样,web 有跳转页面,有验证码,移动端没有,看样子得自定义一个过滤器,验证 token 的形式进行校验