クラス AbstractSecurityWebSocketMessageBrokerConfigurer

  • 実装されたすべてのインターフェース:
    org.springframework.beans.factory.SmartInitializingSingletonorg.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer

    @Order(-2147483548)
    @Import(ObjectPostProcessorConfiguration.class)
    public abstract class AbstractSecurityWebSocketMessageBrokerConfigurer
    extends org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
    implements org.springframework.beans.factory.SmartInitializingSingleton
    WebSocket 認証を設定できます。

    例:

     @Configuration
     public class WebSocketSecurityConfig extends
                    AbstractSecurityWebSocketMessageBrokerConfigurer {
    
            @Override
            protected void configureInbound(MessageSecurityMetadataSourceRegistry messages) {
                    messages.simpDestMatchers("/user/queue/errors").permitAll()
                                    .simpDestMatchers("/admin/**").hasRole("ADMIN").anyMessage()
                                    .authenticated();
            }
     }
     
    導入:
    4.0
    • コンストラクターの詳細

      • AbstractSecurityWebSocketMessageBrokerConfigurer

        public AbstractSecurityWebSocketMessageBrokerConfigurer()
    • メソッドの詳細

      • registerStompEndpoints

        public void registerStompEndpoints​(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
        次で指定:
        インターフェース org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurerregisterStompEndpoints 
      • addArgumentResolvers

        public void addArgumentResolvers​(java.util.List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> argumentResolvers)
        次で指定:
        インターフェース org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigureraddArgumentResolvers 
        オーバーライド:
        クラス org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigureraddArgumentResolvers 
      • configureClientInboundChannel

        public final void configureClientInboundChannel​(org.springframework.messaging.simp.config.ChannelRegistration registration)
        次で指定:
        インターフェース org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurerconfigureClientInboundChannel 
        オーバーライド:
        クラス org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurerconfigureClientInboundChannel 
      • sameOriginDisabled

        protected boolean sameOriginDisabled()

        接続に CSRF トークンが必要かどうかを決定します。これにより、リモートサイトがアプリケーションに接続し、接続を介してデータを読み書きできるようになります。デフォルトは false です(トークンは必須です)。

        サブクラスはこのメソッドをオーバーライドして CSRF 保護を無効にすることができます

        戻り値:
        接続に CSRF トークンが必要な場合は false、それ以外の場合は true
      • customizeClientInboundChannel

        protected void customizeClientInboundChannel​(org.springframework.messaging.simp.config.ChannelRegistration registration)
        サブクラスが ChannelRegistration の構成をカスタマイズできるようにします。
        パラメーター:
        registration - ChannelRegistration をカスタマイズする
      • setApplicationContext

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

        @Deprecated
        public void setMessageExpessionHandler​(java.util.List<SecurityExpressionHandler<org.springframework.messaging.Message<java.lang.Object>>> expressionHandlers)
        使用すべきではありません。
      • setMessageExpressionHandler

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

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

        public void afterSingletonsInstantiated()
        次で指定:
        インターフェース org.springframework.beans.factory.SmartInitializingSingletonafterSingletonsInstantiated