CAS实战(cas-server-3.3.4 + cas-client-3.1.3)八 博客分类: CAS cas-server-3.3.4 + cas-client-3.1.3
3.1.3的配置
下面是3.1.3版本的配置方式,我目前使用的就是3.1.3
我的子系统和CAS服务器是在2个tomcat下,2个tomcat分别使用不同的JDK(2个JDK都得导入密钥,否则会无法认证通过,报CAS无响应错误,当然用同一个JDK也是可以的)CSA服务器是用的8080端口,HTTPS 是8443端口,子系统使用的是9090端口
同样,打开子系统的web.xml,增加如下配置:
<!-- CAS --> <!-- --> <filter> <filter-name>CAS Authentication Filter</filter-name> <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class> <!-- CAS login 服务地址--> <init-param> <param-name>casServerLoginUrl</param-name> <param-value>https://casserver:8443/cas/login</param-value> </init-param> <init-param> <param-name>renew</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>gateway</param-name> <param-value>false</param-value> </init-param> <!-- 客户端应用服务地址--> <init-param> <param-name>serverName</param-name> <param-value>http://server1:9090</param-value> </init-param> </filter>
<!--负责Ticket校验--> <filter> <filter-name>CAS Validation Filter</filter-name> <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class> <init-param> <param-name>casServerUrlPrefix</param-name> <!-- casserver产生密钥的时候输入的"姓名(CN)",并且要有这个域名,或者hosts文件中要有定义 --> <param-value>https://casserver:8443/casTest</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://server1:9090</param-value> </init-param> <init-param> <param-name>useSession</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>redirectAfterValidation</param-name> <param-value>true</param-value> </init-param> </filter>
<filter> <filter-name>CAS HttpServletRequest WrapperFilter</filter-name> <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class> </filter>
<filter> <filter-name>CAS Assertion Thread Local Filter</filter-name> <filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class> </filter>
<filter-mapping> <filter-name>CAS Authentication Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
<filter-mapping> <filter-name>CAS Validation Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
<filter-mapping> <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
<filter-mapping> <filter-name>CAS Assertion Thread Local Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- END CAS -->
|
推荐阅读
-
CAS实战(cas-server-3.3.4 + cas-client-3.1.3)八 博客分类: CAS cas-server-3.3.4 + cas-client-3.1.3
-
CAS实战(cas-server-3.3.4 + cas-client-3.1.3)九 博客分类: CAS cas-server-3.3.4 + cas-client-3.1.3
-
CAS实战(cas-server-3.3.4 + cas-client-3.1.3)九 博客分类: CAS cas-server-3.3.4 + cas-client-3.1.3
-
CAS实战(cas-server-3.3.4 + cas-client-3.1.3)十 博客分类: CAS cas-server-3.3.4 + cas-client-3.1.3
-
CAS实战(cas-server-3.3.4 + cas-client-3.1.3)十 博客分类: CAS cas-server-3.3.4 + cas-client-3.1.3
-
CAS实战(cas-server-3.3.4 + cas-client-3.1.3)八 博客分类: CAS cas-server-3.3.4 + cas-client-3.1.3