I\'m trying to get the user from spring context in an application spring as follows:
Authentication auth = SecurityContextHolder.getContext().getAuthenticati
Spring support for sending asynchronous requests with propagated SecurityContext. From a programming model perspective, the new capabilities appear deceptively simple. You can access to user info in async methods by setting security content strategy name in your security configurer class:
@Configuration
@EnableAsync
public class SpringAsyncConfig implements AsyncConfigurer {
public SpringAsyncConfig() {
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
}
}