Class AbstractSecurityWebSocketMessageBrokerConfigurer

  • All Implemented Interfaces:
    org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer

    @Order(-2147483548)
    @Import(ObjectPostProcessorConfiguration.class)
    @Deprecated
    public abstract class AbstractSecurityWebSocketMessageBrokerConfigurer
    extends org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
    implements org.springframework.beans.factory.SmartInitializingSingleton
    Deprecated.
    Allows configuring WebSocket Authorization.

    For example:

     @Configuration
     public class WebSocketSecurityConfig extends
                    AbstractSecurityWebSocketMessageBrokerConfigurer {
    
            @Override
            protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
                    messages.simpDestMatchers("/user/queue/errors").permitAll()
                                    .simpDestMatchers("/admin/**").hasRole("ADMIN").anyMessage()
                                    .authenticated();
            }
     }
     
    Since:
    4.0
    See Also:
    WebSocketMessageBrokerSecurityConfiguration
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addArgumentResolvers​(java.util.List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> argumentResolvers)
      Deprecated.
       
      void afterSingletonsInstantiated()
      Deprecated.
       
      void configureClientInboundChannel​(org.springframework.messaging.simp.config.ChannelRegistration registration)
      Deprecated.
       
      protected void configureInbound​(MessageSecurityMetadataSourceRegistry messages)
      Deprecated.
       
      org.springframework.security.messaging.web.csrf.CsrfChannelInterceptor csrfChannelInterceptor()
      Deprecated.
       
      protected void customizeClientInboundChannel​(org.springframework.messaging.simp.config.ChannelRegistration registration)
      Deprecated.
      Allows subclasses to customize the configuration of the ChannelRegistration .
      org.springframework.security.messaging.access.intercept.ChannelSecurityInterceptor inboundChannelSecurity​(org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource messageSecurityMetadataSource)
      Deprecated.
       
      org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource inboundMessageSecurityMetadataSource()
      Deprecated.
       
      void registerStompEndpoints​(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
      Deprecated.
       
      protected boolean sameOriginDisabled()
      Deprecated.
      Determines if a CSRF token is required for connecting.
      org.springframework.security.messaging.context.SecurityContextChannelInterceptor securityContextChannelInterceptor()
      Deprecated.
       
      void setApplicationContext​(org.springframework.context.ApplicationContext context)
      Deprecated.
       
      void setMessageExpessionHandler​(java.util.List<org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<java.lang.Object>>> expressionHandlers)
      Deprecated.
      void setMessageExpressionHandler​(java.util.List<org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<java.lang.Object>>> expressionHandlers)
      Deprecated.
       
      void setObjectPostProcessor​(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
      Deprecated.
       
      • Methods inherited from class org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer

        addReturnValueHandlers, configureClientOutboundChannel, configureMessageBroker, configureMessageConverters, configureWebSocketTransport
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractSecurityWebSocketMessageBrokerConfigurer

        public AbstractSecurityWebSocketMessageBrokerConfigurer()
        Deprecated.
    • Method Detail

      • registerStompEndpoints

        public void registerStompEndpoints​(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
        Deprecated.
        Specified by:
        registerStompEndpoints in interface org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
      • addArgumentResolvers

        public void addArgumentResolvers​(java.util.List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> argumentResolvers)
        Deprecated.
        Specified by:
        addArgumentResolvers in interface org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
        Overrides:
        addArgumentResolvers in class org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
      • configureClientInboundChannel

        public final void configureClientInboundChannel​(org.springframework.messaging.simp.config.ChannelRegistration registration)
        Deprecated.
        Specified by:
        configureClientInboundChannel in interface org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
        Overrides:
        configureClientInboundChannel in class org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
      • sameOriginDisabled

        protected boolean sameOriginDisabled()
        Deprecated.

        Determines if a CSRF token is required for connecting. This protects against remote sites from connecting to the application and being able to read/write data over the connection. The default is false (the token is required).

        Subclasses can override this method to disable CSRF protection

        Returns:
        false if a CSRF token is required for connecting, else true
      • customizeClientInboundChannel

        protected void customizeClientInboundChannel​(org.springframework.messaging.simp.config.ChannelRegistration registration)
        Deprecated.
        Allows subclasses to customize the configuration of the ChannelRegistration .
        Parameters:
        registration - the ChannelRegistration to customize
      • csrfChannelInterceptor

        @Bean
        public org.springframework.security.messaging.web.csrf.CsrfChannelInterceptor csrfChannelInterceptor()
        Deprecated.
      • inboundChannelSecurity

        @Bean
        public org.springframework.security.messaging.access.intercept.ChannelSecurityInterceptor inboundChannelSecurity​(org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource messageSecurityMetadataSource)
        Deprecated.
      • securityContextChannelInterceptor

        @Bean
        public org.springframework.security.messaging.context.SecurityContextChannelInterceptor securityContextChannelInterceptor()
        Deprecated.
      • inboundMessageSecurityMetadataSource

        @Bean
        public org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource inboundMessageSecurityMetadataSource()
        Deprecated.
      • setApplicationContext

        @Autowired
        public void setApplicationContext​(org.springframework.context.ApplicationContext context)
        Deprecated.
      • setMessageExpessionHandler

        @Deprecated
        public void setMessageExpessionHandler​(java.util.List<org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<java.lang.Object>>> expressionHandlers)
        Deprecated.
      • setMessageExpressionHandler

        @Autowired(required=false)
        public void setMessageExpressionHandler​(java.util.List<org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<java.lang.Object>>> expressionHandlers)
        Deprecated.
      • setObjectPostProcessor

        @Autowired(required=false)
        public void setObjectPostProcessor​(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
        Deprecated.
      • afterSingletonsInstantiated

        public void afterSingletonsInstantiated()
        Deprecated.
        Specified by:
        afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton