<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:security="http://www.springframework.org/schema/security"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">

    <security:authentication-manager alias="authenticationManager">
        <security:authentication-provider>
            <security:user-service>
                <security:user name="bob" password="bobspassword" authorities="ROLE_A,ROLE_B"/>
            </security:user-service>
        </security:authentication-provider>
    </security:authentication-manager>

    <bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
        <property name="allowIfAllAbstainDecisions" value="false"/>
        <property name="decisionVoters">
            <util:list>
                <bean class="org.springframework.security.access.vote.RoleVoter" />
                <bean class="org.springframework.security.access.vote.AuthenticatedVoter" />
            </util:list>
        </property>
    </bean>

    <bean id="securityInterceptor" class="org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor">
        <property name="validateConfigAttributes" value="true"/>
        <property name="rejectPublicInvocations" value="true"/>
        <property name="authenticationManager" ref="authenticationManager"/>
        <property name="accessDecisionManager" ref="accessDecisionManager"/>
        <property name="securityMetadataSource"><value>
            org.springframework.security.core.session.SessionRegistry.get*=ROLE_C
        </value></property>
    </bean>

    <bean id="httpRemoteService" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces" value="org.springframework.security.core.session.SessionRegistry"/>
        <property name="interceptorNames">
            <list>
                <value>securityInterceptor</value>
                <value>httpInvokerClientInterceptor</value>
            </list>
        </property>
    </bean>

    <bean id="httpInvokerClientInterceptor" class="org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor">
        <property name="serviceUrl" value="http://somehost/someUrl"/>
    </bean>

</beans>
