Apache Shiro ShiroFilterFactoryBean 全局URL配置 loginUrl successUrl unauthorizedUrl FilterChainDefinition 1 2 3 4 5 6 /index.html = anon /user/create = anon /user/** = authc /admin/** = authc, roles[administrator] /rest/** = authc, rest
Apache Shiro
ShiroFilterFactoryBean
全局URL配置
- loginUrl
- successUrl
- unauthorizedUrl
FilterChainDefinition
1
2
3
4
5
6
/index.html = anon
/user/create = anon
/user/** = authc
/admin/** = authc, roles[administrator]
/rest/** = authc, rest
/remoting/rpc/** = authc, perms["remote:invoke"]
以上配置等价于 url = filter1[op1], ..., filterN[opN]
, 一条连接中配置的多个filter组成一条filterChain.
如: /index.html
的filterChian
由anon
(AnonymousFilter
)组成
当浏览器发起请求时候通过url
匹配来选择所需要的filterChain
达到权限过滤的目的.
Shiro Filter
原文:大专栏 Shiro