
Originally Posted by
Luke
Try reading the section in method security in the namespace section in the reference. Also the tutorial application is set up to use Secured annotations with the new namespace syntax, so it shouldn't be so hard to work out with both these available.
Thanks, I did that....my config file looks now like that
Code:
<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns="http://www.springframework.org/schema/security"
xmlns:b="http://www.springframework.org/schema/beans"
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
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">
<http auto-config='true' >
<remember-me user-service-ref='userDetailsService' />
</http>
<!-- Acegi User Load DAO -->
<b:bean id="userDetailsService" class="security.acegi.hibernate.ExtranetUserDAOHibernate" parent="BaseDAOHibernate">
<b:property name="informationManager" ref="informationManager"/>
<b:property name="personManager" ref="personManager"/>
<b:property name="benutzerManager" ref="benutzerManager"/>
<b:property name="secyManager" ref="secyManager"/>
<b:property name="useramtManager" ref="useramtManager"/>
</b:bean>
<b:bean id="httpSessionContextIntegrationFilter" class="org.springframework.security.context.HttpSessionContextIntegrationFilter">
<custom-filter position="SESSION_CONTEXT_INTEGRATION_FILTER"/>
</b:bean>
<b:bean id="exceptionTranslationFilter" class="org.springframework.security.ui.ExceptionTranslationFilter">
<custom-filter position="EXCEPTION_TRANSLATION_FILTER"/>
<b:property name="authenticationEntryPoint">
<b:bean class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
<b:property name="loginFormUrl" value="/index.jsp"/>
<b:property name="forceHttps" value="false"/>
</b:bean>
</b:property>
<b:property name="accessDeniedHandler">
<b:bean class="org.springframework.security.ui.AccessDeniedHandlerImpl">
<b:property name="errorPage" value="/error.jsp"/>
</b:bean>
</b:property>
</b:bean>
<b:bean id="anonymousProcessingFilter" class="org.springframework.security.providers.anonymous.AnonymousProcessingFilter">
<custom-filter position="ANONYMOUS_FILTER"/>
<b:property name="key" value="changeThis"/>
<b:property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS"/>
</b:bean>
<b:bean id="containerAuthenticationFilter" class="najsre7.webapp.filter.ContainerAuthenticationFilter">
<custom-filter position="AUTHENTICATION_PROCESSING_FILTER"/>
<b:property name="authenticationManager" ref="authenticationManager"/>
</b:bean>
<b:bean id="organisationValidationFilter" class="najsre7.webapp.filter.OrganisationValidationFilter">
<custom-filter after="AUTHENTICATION_PROCESSING_FILTER"/>
<b:property name="informationManager" ref="informationManager"/>
</b:bean>
<!-- Access Descision manager -->
<global-method-security access-decision-manager-ref="unanimousBasedAccessDecisionManager" />
<b:bean id="unanimousBasedAccessDecisionManager" class="org.springframework.security.vote.UnanimousBased">
<b:property name="allowIfAllAbstainDecisions" value="false"/>
<b:property name="decisionVoters">
<b:list>
<b:bean class="org.springframework.security.vote.RoleVoter"/>
<b:bean class="org.springframework.security.vote.AuthenticatedVoter"/>
<b:bean class="security.acegi.NDBJSSecurityVoter"/>
</b:list>
</b:property>
</b:bean>
<authentication-manager alias="authenticationManager"/>
<b:bean id="shaPasswordEncoder" class="org.springframework.security.providers.encoding.ShaPasswordEncoder"/>
<authentication-provider user-service-ref='userDetailsService'>
<password-encoder hash="sha"/>
</authentication-provider>
<global-method-security secured-annotations="enabled" />
<!-- The use of protect-pointcut is particularly powerful, as it allows you to apply security to many beans with only a simple declaration. Consider the following example: -->
<global-method-security>
<protect-pointcut expression="execution(* najs*.service..*Manager*Impl*.*(..))" access="ROLE_USER"/>
</global-method-security>
</b:beans>
My Voter (NDBJSVoter) is never called. Anybody knows why?
regards
Angela