Browse Source

SEC-768: Changed exception to error reported through parser context. Added entry-point-ref to cas config

2.0.x
Luke Taylor 18 years ago
parent
commit
83c152e379
  1. 5
      core/src/main/java/org/springframework/security/config/HttpSecurityBeanDefinitionParser.java
  2. 8
      samples/cas/client/src/main/webapp/WEB-INF/applicationContext-security.xml

5
core/src/main/java/org/springframework/security/config/HttpSecurityBeanDefinitionParser.java

@ -414,7 +414,10 @@ public class HttpSecurityBeanDefinitionParser implements BeanDefinitionParser {
return; return;
} }
throw new IllegalStateException("Couldn't set entry point"); parserContext.getReaderContext().error("No AuthenticationEntryPoint could be established. Please" +
"make sure you have a login mechanism configured through the namespace (such as form-login) or" +
"specify a custom AuthenticationEntryPoint with the custom-entry-point-ref ",
parserContext.extractSource(element));
} }
static UrlMatcher createUrlMatcher(Element element) { static UrlMatcher createUrlMatcher(Element element) {

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

@ -5,7 +5,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd"> http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">
<sec:http> <sec:http entry-point-ref="casProcessingFilterEntryPoint">
<sec:intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR" requires-channel="https"/> <sec:intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR" requires-channel="https"/>
<sec:intercept-url pattern="/secure/**" access="ROLE_USER" /> <sec:intercept-url pattern="/secure/**" access="ROLE_USER" />
<sec:logout /> <sec:logout />
@ -28,10 +28,10 @@
<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="userDetailsService" ref="userService"/>
<property name="serviceProperties" ref="serviceProperties" /> <property name="serviceProperties" ref="serviceProperties" />
<property name="ticketValidator"> <property name="ticketValidator">
<bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"> <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator">
<constructor-arg index="0" value="https://localhost:9443/cas" /> <constructor-arg index="0" value="https://localhost:9443/cas" />
</bean> </bean>
</property> </property>

Loading…
Cancel
Save