【cas】【shiro】framework-auth 使用用例

1.引入jar文件

<dependency>
    <groupId>cn.bidlink.nbl</groupId>
    <artifactId>framework-auth</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</dependency>
2.添加framework-auth filter 到 web.xml
<filter>
    <filter-name>systemShiroFilter</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    <init-param>
        <param-name>targetFilterLifecycle</param-name>
        <param-value>true</param-value>
    </init-param>
</filter>
<!-- 过滤cas登陆与退出路径 -->
<filter-mapping>
    <filter-name>systemShiroFilter</filter-name>
    <url-pattern>/cas/*</url-pattern>
</filter-mapping>
<!-- 过滤html路径 -->
<filter-mapping>
    <filter-name>systemShiroFilter</filter-name>
    <url-pattern>/portal/*</url-pattern>
</filter-mapping>
<!-- 过滤json路径 -->
<filter-mapping>
    <filter-name>systemShiroFilter</filter-name>
    <url-pattern>/json/*</url-pattern>
</filter-mapping>

3.引入spring配置文件 classpath:spring-nbl-framework-auth/applicationContext-auth.xml

4.添加配置到auth-prop.properties

cas.server.prefix.url=https://testcas.ebnew.com:2440/cas
cas.token.valid.url=http://hhostt:8080/cas/login
cas.token.valid.error.redirect.url=/
login.view.url=http://testsmart.ebnew.com/work/login.htm?service=http://hhostt:8080/cas/login
logout.success.redirect.url=http://testsmart.ebnew.com/work/login.htm?service=http://hhostt:8080/cas/login


注:如有更好的方法,请告知,不胜感激。

你可能感兴趣的:(【cas】【shiro】framework-auth 使用用例)