shiro 配置都正确,不能进入自定义realm
2017-08-03 00:34
453 查看
解决办法: 表单应该为post 方式, 而且访问路径后缀也必须一样。
分析原因:
分析原因:
org.apache.shiro.web.filter.authc.FormAuthenticationFilter protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { if (isLoginRequest(request, response)) { if (isLoginSubmission(request, response)) { if (log.isTraceEnabled()) { log.trace("Login submission detected. Attempting to execute login."); } return executeLogin(request, response); } else { if (log.isTraceEnabled()) { log.trace("Login page view."); } //allow them to see the login page ;) return true; } } else { if (log.isTraceEnabled()) { log.trace("Attempting to access a path which requires authentication. Forwarding to the " + "Authentication url [" + getLoginUrl() + "]"); } saveRequestAndRedirectToLogin(request, response); return false; } }
isLoginRequest 判断是否为 loginUrl 值
isLoginSubmission 源码: protected boolean isLoginSubmission(ServletRequest request, ServletResponse response) { return (request instanceof HttpServletRequest) && WebUtils.toHttp(request).getMethod().equalsIgnoreCase(POST_METHOD); } 判断是否为post方式的表单提交。 所以非post 方式一直是登录页面死循环。
相关文章推荐
- 使用Spring配置shiro时,自定义Realm中属性无法使用注解注入解决办法
- 使用Spring配置shiro时,自定义Realm中属性无法使用注解注入解决办法
- spring集成shiro不进入自定义realm
- 在运行hadoopdb\hive\hadoop源码时不能正确调用自定义core-site.xml等配置文件
- 当shiro不进入自定义realm的权限认证方法时
- 使用Spring配置shiro时,自定义Realm中属性无法使用注解注入解决办法
- ssm和shiro整合,shiro的自定义的realm不能自动注入的问题
- 使用Spring配置shiro时,自定义Realm中属性无法使用注解注入解决办法
- 使用Spring配置shiro时,自定义Realm中属性无法使用注解注入解决办法
- 当shiro不进入自定义realm的权限认证方法时
- shiro实现手机验证码登录(涉及到:自定义token、多realm配置、自定义ModularRealmAuthenticator)
- 【Shiro】Apache Shiro架构之自定义realm
- shiro自定义Realm实现
- shiro使用经验总结:【同时实现url和按钮的拦截,只能用配置文件。不需要用注解!!!已多次测试=@RequiresPermissions不能拦截url直接访问。只能拦截标签(鸡肋,不要用!!)
- 提示“应用程序无法启动,因为应用程序的并行配置不正确”不能加载 System.Data.SQLite.dll
- Shiro入门7:修改自定义realm支持散列MD5密码对比
- shiro中自定义realm实现md5散列算法加密的模拟
- 【坑】当java的环境变量配置正确还是不能运行eclipse的情况
- 解决配置apache虚拟主机后,只能进入欢迎页面(默认欢迎页面),不能进入虚拟主机目录页面
- shiro一,自定义realm