关于resin的认证框架

用户重复登录问题解析

在未logout的情况下,当前的用户无法重新登录成功。查看com.caucho.server.security.FormLogin源代码发现:

public Principal authenticate(HttpServletRequest request, HttpServletResponse response, ServletContext application) throws ServletException, IOException { Principal user = getUserPrincipal(request, response, application); if (user != null) return user; String path = request.getServletPath(); if (path == null) path = request.getPathInfo(); else if (request.getPathInfo() != null) path = path + request.getPathInfo(); if (path.equals("")) { // Forward? path = request.getContextPath() + "/"; response.sendRedirect(response.encodeRedirectURL(path)); return null; } Application app = (Application) application; String uri = request.getRequestURI(); if (path.endsWith("/j_security_check")) { ... } }

也就是说,即使用户重新填写登录框并提交至j_security_check,authenticate()还是优先采用已有的用户信息,因此新的认证校验永远不会被调用!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值