浏览代码

SEC-745: updated cas sample filter bean configuration

Luke Taylor 16 年之前
父节点
当前提交
65a78ce4a4
共有 1 个文件被更改,包括 16 次插入8 次删除
  1. 16 8
      samples/cas/client/src/main/webapp/WEB-INF/applicationContext-security.xml

+ 16 - 8
samples/cas/client/src/main/webapp/WEB-INF/applicationContext-security.xml

@@ -16,8 +16,16 @@
     <bean id="casProcessingFilter" class="org.springframework.security.ui.cas.CasProcessingFilter">
         <sec:custom-filter after="CAS_PROCESSING_FILTER"/>
         <property name="authenticationManager" ref="authenticationManager"/>
-        <property name="authenticationFailureUrl" value="/casfailed.jsp"/>
-        <property name="defaultTargetUrl" value="/"/>
+        <property name="authenticationFailureHandler">
+            <bean class="org.springframework.security.ui.SimpleUrlAuthenticationFailureHandler">
+                <property name="defaultFailureUrl" value="/casfailed.jsp"/>
+            </bean>
+        </property>
+        <property name="authenticationSuccessHandler">
+            <bean class="org.springframework.security.ui.SimpleUrlAuthenticationSuccessHandler">
+                <property name="defaultTargetUrl" value="/"/>
+            </bean>
+        </property>
         <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage" />
         <property name="proxyReceptorUrl" value="/secure/receptor" />
     </bean>
@@ -32,15 +40,15 @@
         <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" />
-        		<property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage" />
-        		<property name="proxyCallbackUrl" value="https://localhost:8443/cas-sample/secure/receptor" />
+            <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
+                <constructor-arg index="0" value="https://localhost:9443/cas" />
+                <property name="proxyGrantingTicketStorage" ref="proxyGrantingTicketStorage" />
+                <property name="proxyCallbackUrl" value="https://localhost:8443/cas-sample/secure/receptor" />
             </bean>
         </property>
         <property name="key" value="an_id_for_this_auth_provider_only"/>
     </bean>
-    
+
     <bean id="proxyGrantingTicketStorage" class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl" />
 
     <bean id="serviceProperties" class="org.springframework.security.ui.cas.ServiceProperties">
@@ -53,4 +61,4 @@
         <sec:user name="dianne" password="dianne" authorities="ROLE_USER" />
         <sec:user name="scott" password="scott" authorities="ROLE_USER" />
     </sec:user-service>
-</beans>
+</beans>