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

    Constructors
    Constructor
    Description
    AuthorizationChannelInterceptor(org.springframework.security.authorization.AuthorizationManager<org.springframework.messaging.Message<?>> preSendAuthorizationManager)
    Creates a new instance
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.messaging.Message<?>
    preSend(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)
     
    void
    setAuthorizationEventPublisher(org.springframework.security.authorization.AuthorizationEventPublisher eventPublisher)
    Use this AuthorizationEventPublisher to publish the AuthorizationManager result.
    void
    setSecurityContextHolderStrategy(org.springframework.security.core.context.SecurityContextHolderStrategy securityContextHolderStrategy)
    Sets the SecurityContextHolderStrategy 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(org.springframework.security.authorization.AuthorizationManager<org.springframework.messaging.Message<?>> preSendAuthorizationManager)
      Creates a new instance
      Parameters:
      preSendAuthorizationManager - the AuthorizationManager 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 interface org.springframework.messaging.support.ChannelInterceptor
    • 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.
    • setAuthorizationEventPublisher

      public void setAuthorizationEventPublisher(org.springframework.security.authorization.AuthorizationEventPublisher eventPublisher)
      Use this AuthorizationEventPublisher to publish the AuthorizationManager result.
      Parameters:
      eventPublisher -