It's a little hard to tell what is happening here. Something isn't right with the authentication/authorization based on the error, but it's not clear where it's going wrong. I'm also not sure I understand what you're trying to do with `preSend(..)`.
I would suggest taking a look at this sample applicationhttps://github.com/spring-projects/spring-session/tree/master/spring-session-samples/spring-session-sample-boot-websocket
It shows how to set up WebSockets & secure messages. You can then adjust the Spring Security configuration to enable OAuth2 support.
I haven't done it, but based on the docs...
>WebSockets reuse the same authentication information that is found in the HTTP request when the WebSocket connection was made.
https://docs.spring.io/spring-security/site/docs/5.2.2.RELEASE/reference/htmlsingle/#websocket-authentication
I don't think you need to do anything special to enable OAuth2 & JWT support. If you use Spring Security's standard configuration to set up a resource server, https://docs.spring.io/spring-security/site/docs/5.2.2.RELEASE/reference/htmlsingle/#oauth2resourceserver, based on the doc comment above the app should just have access to the authentication information for securing your message endpoints.
Having said all that, I don't know anything about the app you're trying to build or requirements you have, so your mileage may vary. Hope this points you in the right direction.