单点登录cas与权限管理框架shiro集成------spring项目方式

2014-11-24 07:17:30 · 作者: · 浏览: 38

之前那篇文章介绍了普通web项目中单点登录cas与权限管理框架shiro集成方式,这里说下spring项目中的集成方式,首先还是配置一个filter

[html]

shiroFilter
org.springframework.web.filter.DelegatingFilterProxy

targetFilterLifecycle
true




shiroFilter
/*


然后就是shiro的spring bean配置,其实就是把之前的shiro.ini的东西配成spring的bean,shiro-config.xml文件如下:

[html]
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd"
default-lazy-init="true">














/shiro-cas = casFilter
/admin/** = roles[ROLE_USER]
/** = anon






jsp"/>



























摘自laigood12345的专栏