Class SecurityContextCallableProcessingInterceptor

java.lang.Object
org.springframework.security.web.context.request.async.SecurityContextCallableProcessingInterceptor
All Implemented Interfaces:
org.springframework.web.context.request.async.CallableProcessingInterceptor

public final class SecurityContextCallableProcessingInterceptor extends Object implements org.springframework.web.context.request.async.CallableProcessingInterceptor

Allows for integration with Spring MVC's Callable support.

A CallableProcessingInterceptor that establishes the injected SecurityContext on the SecurityContextHolder when preProcess(NativeWebRequest, Callable) is invoked. It also clear out the SecurityContextHolder by invoking SecurityContextHolder.clearContext() in the postProcess(NativeWebRequest, Callable, Object) method.

Since:
3.2
  • Constructor Details

  • Method Details

    • beforeConcurrentHandling

      public <T> void beforeConcurrentHandling(org.springframework.web.context.request.NativeWebRequest request, Callable<T> task)
      Specified by:
      beforeConcurrentHandling in interface org.springframework.web.context.request.async.CallableProcessingInterceptor
    • preProcess

      public <T> void preProcess(org.springframework.web.context.request.NativeWebRequest request, Callable<T> task)
      Specified by:
      preProcess in interface org.springframework.web.context.request.async.CallableProcessingInterceptor
    • postProcess

      public <T> void postProcess(org.springframework.web.context.request.NativeWebRequest request, Callable<T> task, Object concurrentResult)
      Specified by:
      postProcess in interface org.springframework.web.context.request.async.CallableProcessingInterceptor
    • setSecurityContextHolderStrategy

      public void setSecurityContextHolderStrategy(org.springframework.security.core.context.SecurityContextHolderStrategy securityContextHolderStrategy)
      Sets the SecurityContextHolderStrategy to use. The default action is to use the SecurityContextHolderStrategy stored in SecurityContextHolder.
      Since:
      5.8