Prevent redirect to /login

Hi! I’m trying to implement a websocket endpoint with javax (it may be better to use spring’s websocket, but javax seems easier for what I need). The problem I found is when I try to connect to http://my-application/websocket, it automatically redirects to http://my-application/login making it imposible for the client to connect.

Is there any way to prevent this behavior? Or maybe some “redirect-safe” paths by default (just like /rest) that can be used for this purpose?

Thank you!

Hi,

Try registering a SecurityFilterChain bean for your endpoints like it is described in this topic.

1 Like