Spring-beveiligingscontext is altijd gebonden aan Threadlocal.
Waarschijnlijk kunt u bovendien MODE_INHERITABLETHREADLOCAL instellen voor de beveiligingscontext.
@Bean
public MethodInvokingFactoryBean methodInvokingFactoryBean() {
MethodInvokingFactoryBean methodInvokingFactoryBean = new MethodInvokingFactoryBean();
methodInvokingFactoryBean.setTargetClass(SecurityContextHolder.class);
methodInvokingFactoryBean.setTargetMethod("setStrategyName");
methodInvokingFactoryBean.setArguments(new String[]{SecurityContextHolder.MODE_INHERITABLETHREADLOCAL});
return methodInvokingFactoryBean;
}
http://www.ogrigas .eu/spring/2010/04/inherit-spring-security-context-in-child-threads
Hoe stel je de Spring Security SecurityContextHolder-strategie in?