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
ConstructorDescriptionAuthorizationChannelInterceptor
(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) void
setAuthorizationEventPublisher
(AuthorizationEventPublisher eventPublisher) Use thisAuthorizationEventPublisher
to publish theAuthorizationManager
result.void
setSecurityContextHolderStrategy
(SecurityContextHolderStrategy securityContextHolderStrategy) Sets theSecurityContextHolderStrategy
to use.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
- theAuthorizationManager
to 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:
preSend
in interfaceorg.springframework.messaging.support.ChannelInterceptor
-
setSecurityContextHolderStrategy
public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) Sets theSecurityContextHolderStrategy
to use. The default action is to use theSecurityContextHolderStrategy
stored inSecurityContextHolder
. -
setAuthorizationEventPublisher
Use thisAuthorizationEventPublisher
to publish theAuthorizationManager
result.- Parameters:
eventPublisher
-
-