クラス AbstractSecurityWebSocketMessageBrokerConfigurer
- java.lang.Object
-
- org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
-
- org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer
- 実装されたすべてのインターフェース:
org.springframework.beans.factory.SmartInitializingSingleton
,org.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()
メソッドのサマリー
すべてのメソッド インスタンスメソッド 具象メソッド 非推奨のメソッド 修飾子と型 メソッド 説明 void
addArgumentResolvers(java.util.List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> argumentResolvers)
void
afterSingletonsInstantiated()
void
configureClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
protected void
configureInbound(MessageSecurityMetadataSourceRegistry messages)
CsrfChannelInterceptor
csrfChannelInterceptor()
protected void
customizeClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
サブクラスがChannelRegistration
の構成をカスタマイズできるようにします。ChannelSecurityInterceptor
inboundChannelSecurity(MessageSecurityMetadataSource messageSecurityMetadataSource)
MessageSecurityMetadataSource
inboundMessageSecurityMetadataSource()
void
registerStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
protected boolean
sameOriginDisabled()
接続に CSRF トークンが必要かどうかを決定します。SecurityContextChannelInterceptor
securityContextChannelInterceptor()
void
setApplicationContext(org.springframework.context.ApplicationContext context)
void
setMessageExpessionHandler(java.util.List<SecurityExpressionHandler<org.springframework.messaging.Message<java.lang.Object>>> expressionHandlers)
使用すべきではありません。void
setMessageExpressionHandler(java.util.List<SecurityExpressionHandler<org.springframework.messaging.Message<java.lang.Object>>> expressionHandlers)
void
setObjectPostProcessor(ObjectPostProcessor<java.lang.Object> objectPostProcessor)
メソッドの詳細
registerStompEndpoints
public void registerStompEndpoints(org.springframework.web.socket.config.annotation.StompEndpointRegistry registry)
- 次で指定:
- インターフェース
org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
のregisterStompEndpoints
addArgumentResolvers
public void addArgumentResolvers(java.util.List<org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver> argumentResolvers)
- 次で指定:
- インターフェース
org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
のaddArgumentResolvers
- オーバーライド:
- クラス
org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
のaddArgumentResolvers
configureClientInboundChannel
public final void configureClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
- 次で指定:
- インターフェース
org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
のconfigureClientInboundChannel
- オーバーライド:
- クラス
org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
のconfigureClientInboundChannel
sameOriginDisabled
protected boolean sameOriginDisabled()
接続に CSRF トークンが必要かどうかを決定します。これにより、リモートサイトがアプリケーションに接続し、接続を介してデータを読み書きできるようになります。デフォルトは false です(トークンは必須です)。
サブクラスはこのメソッドをオーバーライドして CSRF 保護を無効にすることができます
- 戻り値:
- 接続に CSRF トークンが必要な場合は false、それ以外の場合は true
customizeClientInboundChannel
protected void customizeClientInboundChannel(org.springframework.messaging.simp.config.ChannelRegistration registration)
サブクラスがChannelRegistration
の構成をカスタマイズできるようにします。- パラメーター:
registration
-ChannelRegistration
をカスタマイズする
csrfChannelInterceptor
@Bean public CsrfChannelInterceptor csrfChannelInterceptor()
inboundChannelSecurity
@Bean public ChannelSecurityInterceptor inboundChannelSecurity(MessageSecurityMetadataSource messageSecurityMetadataSource)
securityContextChannelInterceptor
@Bean public SecurityContextChannelInterceptor securityContextChannelInterceptor()
inboundMessageSecurityMetadataSource
@Bean public MessageSecurityMetadataSource inboundMessageSecurityMetadataSource()
configureInbound
protected void configureInbound(MessageSecurityMetadataSourceRegistry messages)
- パラメーター:
messages
-
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.SmartInitializingSingleton
のafterSingletonsInstantiated