<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 https://www.springframework.org/schema/beans/spring-beans-3.0.xsd
	http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util-3.0.xsd
	http://www.springframework.org/schema/security https://www.springframework.org/schema/security/spring-security.xsd">

	<security:authentication-manager alias="authenticationManager">
		<security:authentication-provider>
			<security:user-service>
				<security:user name="bob" password="{noop}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">
		<constructor-arg>
			<util:list>
				<bean class="org.springframework.security.access.vote.RoleVoter" />
				<bean class="org.springframework.security.access.vote.AuthenticatedVoter" />
			</util:list>
		</constructor-arg>
		<property name="allowIfAllAbstainDecisions" value="false"/>
	</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">
			<security:method-security-metadata-source>
				<security:protect method="org.springframework.security.core.session.SessionRegistry.get*" access="ROLE_C" />
			</security:method-security-metadata-source>
		</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="https://somehost/someUrl"/>
	</bean>

</beans>
