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 java.lang.Object implements org.springframework.messaging.support.ChannelInterceptor
AuthorizesMessage
resources using the providedAuthorizationManager
- Since:
- 5.8
-
-
Constructor Summary
Constructors Constructor Description AuthorizationChannelInterceptor(AuthorizationManager<org.springframework.messaging.Message<?>> preSendAuthorizationManager)
Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.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.
-
-
-
Constructor Detail
-
AuthorizationChannelInterceptor
public AuthorizationChannelInterceptor(AuthorizationManager<org.springframework.messaging.Message<?>> preSendAuthorizationManager)
Creates a new instance- Parameters:
preSendAuthorizationManager
- theAuthorizationManager
to use. Cannot be null.
-
-
Method Detail
-
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
public void setAuthorizationEventPublisher(AuthorizationEventPublisher eventPublisher)
Use thisAuthorizationEventPublisher
to publish theAuthorizationManager
result.- Parameters:
eventPublisher
-
-
-