浏览代码

SEC-730

updated configuration to new CAS client
Scott Battaglia 17 年之前
父节点
当前提交
ea489baf6f

+ 1 - 1
cas/pom.xml

@@ -6,7 +6,7 @@
         <artifactId>spring-security-parent</artifactId>
         <artifactId>spring-security-parent</artifactId>
         <version>2.0-SNAPSHOT</version>
         <version>2.0-SNAPSHOT</version>
     </parent>
     </parent>
-    <artifactId>spring-security-cas</artifactId>
+    <artifactId>spring-security-cas-client</artifactId>
     <name>Spring Security - CAS support</name>
     <name>Spring Security - CAS support</name>
     <packaging>jar</packaging>
     <packaging>jar</packaging>
 
 

+ 2 - 2
samples/cas/Readme.txt

@@ -10,11 +10,11 @@ client - this contains the actual sample web application which uses the cas serv
 Running the CAS Server
 Running the CAS Server
 -----------------------
 -----------------------
 
 
-You first need to download the CAS server 3.1.1 distribution from
+You first need to download the CAS server 3.2 distribution from
 
 
 http://www.ja-sig.org/products/cas/downloads/index.html
 http://www.ja-sig.org/products/cas/downloads/index.html
 
 
-You only need the modules/cas-server-webapp-3.1.1.war web application file from the distribution. Copy this to the
+You only need the modules/cas-server-webapp-3.2.war web application file from the distribution. Copy this to the
 "server" directory inside the one that contains this readme file (i.e. copy it to samples/cas/server).
 "server" directory inside the one that contains this readme file (i.e. copy it to samples/cas/server).
 
 
 You can then run the CAS server (from the same) by executing the maven command
 You can then run the CAS server (from the same) by executing the maven command

+ 12 - 7
samples/cas/client/pom.xml

@@ -38,12 +38,7 @@
             <artifactId>spring-aop</artifactId>
             <artifactId>spring-aop</artifactId>
             <scope>runtime</scope>
             <scope>runtime</scope>
         </dependency>
         </dependency>
-        <dependency>
-          <groupId>net.sf.ehcache</groupId>
-          <artifactId>ehcache</artifactId>
-          <version>1.3.0</version>
-          <scope>runtime</scope>
-        </dependency>        
+    
         <dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
             <artifactId>slf4j-log4j12</artifactId>
@@ -82,7 +77,17 @@
                             <truststore>../../certificates/server.jks</truststore>
                             <truststore>../../certificates/server.jks</truststore>
                             <trustPassword>password</trustPassword>
                             <trustPassword>password</trustPassword>
                         </connector>
                         </connector>
-                    </connectors>
+                    </connectors>
+			         <systemProperties>
+			            <systemProperty>
+			              <name>javax.net.ssl.trustStore</name>
+			               <value>../../certificates/server.jks</value>
+			            </systemProperty>
+			            <systemProperty>
+			            	<name>javax.net.ssl.trustStorePassword</name>
+			            	<value>password</value>
+			            </systemProperty>
+					</systemProperties>
                 </configuration>
                 </configuration>
             </plugin>
             </plugin>
         </plugins>
         </plugins>

+ 5 - 24
samples/cas/client/src/main/webapp/WEB-INF/applicationContext-security.xml

@@ -28,30 +28,11 @@
 
 
     <bean id="casAuthenticationProvider" class="org.springframework.security.providers.cas.CasAuthenticationProvider">
     <bean id="casAuthenticationProvider" class="org.springframework.security.providers.cas.CasAuthenticationProvider">
         <sec:custom-authentication-provider />
         <sec:custom-authentication-provider />
-        <property name="userDetailsService" ref="userService"/>
-        <property name="casProxyDecider">
-            <bean class="org.springframework.security.providers.cas.proxy.RejectProxyTickets"/>
-        </property>
-        <property name="ticketValidator">
-            <bean class="org.springframework.security.providers.cas.ticketvalidator.CasProxyTicketValidator">
-                <property name="casValidate" value="https://localhost:9443/cas/proxyValidate"/>
-                <property name="proxyCallbackUrl" value="https://localhost:8443/cas-sample/casProxy/receptor"/>
-                <property name="serviceProperties" ref="serviceProperties"/>
-                <property name="trustStore" value="../../certificates/server.jks"/>
-                <property name="trustPassword" value="password"/>
-                <!-- <property name="trustStore"><value>/some/path/to/your/lib/security/cacerts</value></property> -->
-            </bean>
-        </property>
-        <property name="statelessTicketCache">
-            <bean class="org.springframework.security.providers.cas.cache.EhCacheBasedTicketCache">
-                <property name="cache">
-                    <bean class="org.springframework.cache.ehcache.EhCacheFactoryBean">
-                        <property name="cacheManager">
-                            <bean class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>
-                        </property>
-                        <property name="cacheName" value="ticketCache"/>
-                    </bean>
-                </property>
+        <property name="userDetailsService" ref="userService"/>
+        <property name="serviceProperties" ref="serviceProperties" />
+        <property name="ticketValidator">
+        	<bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
+        		<constructor-arg index="0" value="https://localhost:9443/cas" />
             </bean>
             </bean>
         </property>
         </property>
         <property name="key" value="an_id_for_this_auth_provider_only"/>
         <property name="key" value="an_id_for_this_auth_provider_only"/>