Skip to content

Latest commit

 

History

History

context-manager-spring-security

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Maven Version

Spring Security Context propagation library

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.

How to use this library

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.