Shiro常用的Filter过滤器

Shiro常用的Filter过滤器

核心过滤器: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

    • 角色授权拦截器,验证用户是或否拥有角色。
    • 参数可写多个,表示某些角色才能通过,当有多个参数时必须每个参数都通过才算通过
  • perms:org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter

    • 权限授权拦截器,验证用户是否拥有权限
    • 参数可写多个,表示需要某些权限才能通过,当有多个参数时必须每个参数都通过才算可以
  • 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才能通过。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值