-
核心过滤器类:DefaultFilter, 配置哪个路径对应哪个拦截器进行处理
-
authc:org.apache.shiro.web.filter.authc.FormAuthenticationFilter
- 需要认证登录才能访问
-
user:org.apache.shiro.web.filter.authc.UserFilter
- 用户拦截器,表示必须存在用户。
-
anon:org.apache.shiro.web.filter.authc.AnonymousFilter
- 匿名拦截器,不需要登录即可访问的资源,匿名用户或游客,一般用于过滤静态资源。
-
roles:org.apache.shiro.web.filter.authz.RolesAuthorizationFilter
- 角色授权拦截器,验证用户是或否拥有角色。
- 参数可写多个,表示某些角色才能通过,多个参数时写 roles["admin,user"],当有多个参数时必须每个参数都通过才算通过
-
perms:org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter
- 权限授权拦截器,验证用户是否拥有权限
- 参数可写多个,表示需要某些权限才能通过,多个参数时写 perms["user, admin"],当有多个参数时必须每个参数都通过才算可以
-
authcBasic:org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter
- httpBasic 身份验证拦截器。
-
logout:org.apache.shiro.web.filter.authc.LogoutFilter
- 退出拦截器,执行后会直接跳转到
shiroFilterFactoryBean.setLoginUrl();设置的 url
- 退出拦截器,执行后会直接跳转到
-
port:org.apache.shiro.web.filter.authz.PortFilter
- 端口拦截器, 可通过的端口。
-
ssl:org.apache.shiro.web.filter.authz.SslFilter
- ssl拦截器,只有请求协议是https才能通过。
第十节 Shiro内置的Filter过滤器讲解
最新推荐文章于 2023-08-21 17:22:28 发布
2126

被折叠的 条评论
为什么被折叠?



