【shiro】authc与logout

DefaultFilterChainManager会默认添加org.apache.shiro.web.filter.mgt.DefaultFilter中声明的拦截器:

Java代码

  1. public enum DefaultFilter {
  2. anon(AnonymousFilter.class),
  3. authc(FormAuthenticationFilter.class),
  4. authcBasic(BasicHttpAuthenticationFilter.class),
  5. logout(LogoutFilter.class),
  6. noSessionCreation(NoSessionCreationFilter.class),
  7. perms(PermissionsAuthorizationFilter.class),
  8. port(PortFilter.class),
  9. rest(HttpMethodPermissionFilter.class),
  10. roles(RolesAuthorizationFilter.class),
  11. ssl(SslFilter.class),
  12. user(UserFilter.class);
  13. }
时间: 2024-08-29 02:50:29

【shiro】authc与logout的相关文章

【shiro】org.apache.shiro.authc.IncorrectCredentialsException: Submitted credentials for token

org.apache.shiro.authc.IncorrectCredentialsException: Submitted credentials for token [org.apache.shiro.authc.UsernamePasswordToken - admin, rememberMe=true] did not match the expected credentials. at org.apache.shiro.realm.AuthenticatingRealm.assert

自定义 UsernamePasswordToken 报错 java.lang.ClassCastException: org.apache.shiro.authc.UsernamePasswordToken cannot be cast to

UsernamePasswordToken 转型时 出现了异常 代码如下 没有地方使用我们的自己扩展的CustomerUsernamePasswordToken类,只是转型而已,并没有去实例化它,这才是引起问题的根源,问题发现了要如何解决它呢?我们在配置的使用并并未制定表单过滤器,此时默认使用的是FormAuthenticationFilter,而Token默认使用的也是UsernamePasswordToken,由此看来,我们扩展的CustomerUsernamePasswordToken就成

web工程使用spring mvc+shiro进行权限控制

第1步:引入shiro相关jar包 ehcache-core-2.5.0.jar shiro-ehcache-1.2.3.jar shiro-core-1.2.3.jar shiro-web-1.2.3.jar shiro-spring-1.2.3.jar 第二步:web.xml配置 <!-- shiro的filter --> <!-- shiro过虑器,DelegatingFilterProxy通过代理模式将spring容器中的bean和filter关联起来 --> <fi

Shiro安全框架入门篇(登录验证实例详解与源码)

一.Shiro框架简单介绍 Apache Shiro是Java的一个安全框架,旨在简化身份验证和授权.Shiro在JavaSE和JavaEE项目中都可以使用.它主要用来处理身份认证,授权,企业会话管理和加密等.Shiro的具体功能点如下: (1)身份认证/登录,验证用户是不是拥有相应的身份: (2)授权,即权限验证,验证某个已认证的用户是否拥有某个权限:即判断用户是否能做事情,常见的如:验证某个用户是否拥有某个角色.或者细粒度的验证某个用户对某个资源是否具有某个权限: (3)会话管理,即用户登录

shiro的权限控制应用,集成spring项目,密码错误次数过多短时间锁定

以前对shiro都是一知半解,最近系统学了一遍shiro并集成到了在做的项目中. 下面就详细向大家描述一下shiro的用法. 首先是对spring的配置文件,如下: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3

Web项目Shiro总结及源码(十六)

shiro过虑器 过滤器简称 对应的java类 anon org.apache.shiro.web.filter.authc.AnonymousFilter authc org.apache.shiro.web.filter.authc.FormAuthenticationFilter authcBasic org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter perms org.apache.shiro.web.filt

Spring shiro学习(二)

shiro 默认自带的过滤器如下: Filter Name Class anon org.apache.shiro.web.filter.authc.AnonymousFilter authc org.apache.shiro.web.filter.authc.FormAuthenticationFilter authcBasic org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter logout org.apache.s

Shiro与Spring集成

1.新建web工程,加入 Spring 和 Shiro 的 jar 包 2.配置web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta

Shiro 入门

Apache Shiro(http://shiro.apache.org/) 是 Java 的一个安全(权限)框架. Shiro 可以非常容易的开发出足够好的应用,其不仅可以用在 JavaSE 环境,也可以用在 JavaEE 环境. Shiro 可以完成:认证.授权.加密.会话管理.与Web 集成.缓存等. 主要类介绍 Authentication:身份认证/登录,验证用户是不是拥有相应的身份:1. Authorization:授权,即权限验证,验证某个已认证的用户是否拥有某个权限:即判断用户是