Adding the spring-security-context
jar to your classpath
is all that is needed to let the
Security Context
from Spring Security
be automatically included into the ContextSnapshot
.
Add it to your classpath.
<dependency>
<groupId>nl.talsmasoftware.context</groupId>
<artifactId>spring-security-context</artifactId>
<version>[see Maven badge above]</version>
</dependency>
Done!
Now the SecurityContextHolder.getContext()
is copied into each snapshot
from the ContextSnapshot.capture()
method
to be reactivated by the Contextsnapshot.reactivate()
call.
The ContextAwareExecutorService
automatically propagates the active
spring security Authentication
into all executed tasks this way.