-
Notifications
You must be signed in to change notification settings - Fork 245
Description
Describe the issue
I am using AbstractSecurityWebSocketMessageBrokerConfigurer with Spring Cloud Bus. The order of the ChannelInterceptors defined in the configurer leads to problems when not authenticated. Because ChannelSecurityInterceptor is added before SecurityContextChannelInterceptor, ChannelSecurityInterceptor has no security context when there is not already an authentication.
StreamBridge adds the ChannelInterceptors in the order it gets them from the application context which is CsrfChannelInterceptor, ChannelSecurityInterceptor, SecurityContextChannelInterceptor.
To Reproduce
Steps to reproduce the behavior:
- Use Spring Cloud Bus with spring-security-config AbstractSecurityWebSocketMessageBrokerConfigurer with inbound constraints.
messages.anyMessage().permitAll()is sufficient. - Incoming events lead to "AbstractSecurityInterceptor.authenticationNotFound" due to a missing security context.
Version of the framework
3.1.1.
Expected behavior
An anonymous security context will be used and no failures.
Additional context
I manually changed the order of the ChannelInterceptors to CsrfChannelInterceptor, SecurityContextChannelInterceptor, ChannelSecurityInterceptor and it worked fine.