Class AuthorizationChannelInterceptor
java.lang.Object
org.springframework.security.messaging.access.intercept.AuthorizationChannelInterceptor
- All Implemented Interfaces:
org.springframework.messaging.support.ChannelInterceptor
public final class AuthorizationChannelInterceptor
extends Object
implements org.springframework.messaging.support.ChannelInterceptor
Authorizes
Message resources using the provided AuthorizationManager- Since:
- 5.8
-
Constructor Summary
ConstructorsConstructorDescriptionAuthorizationChannelInterceptor(AuthorizationManager<org.springframework.messaging.Message<?>> preSendAuthorizationManager) Creates a new instance -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.messaging.Message<?>preSend(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel) voidsetAuthorizationEventPublisher(AuthorizationEventPublisher eventPublisher) Use thisAuthorizationEventPublisherto publish theAuthorizationManagerresult.voidsetSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) Sets theSecurityContextHolderStrategyto use.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.messaging.support.ChannelInterceptor
afterReceiveCompletion, afterSendCompletion, postReceive, postSend, preReceive
-
Constructor Details
-
AuthorizationChannelInterceptor
public AuthorizationChannelInterceptor(AuthorizationManager<org.springframework.messaging.Message<?>> preSendAuthorizationManager) Creates a new instance- Parameters:
preSendAuthorizationManager- theAuthorizationManagerto use. Cannot be null.
-
-
Method Details
-
preSend
public org.springframework.messaging.Message<?> preSend(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel) - Specified by:
preSendin interfaceorg.springframework.messaging.support.ChannelInterceptor
-
setSecurityContextHolderStrategy
public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) Sets theSecurityContextHolderStrategyto use. The default action is to use theSecurityContextHolderStrategystored inSecurityContextHolder. -
setAuthorizationEventPublisher
Use thisAuthorizationEventPublisherto publish theAuthorizationManagerresult.- Parameters:
eventPublisher-
-