Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to configure websocket handshake interceptors #77

Open
oscararias opened this issue Apr 6, 2020 · 1 comment
Open

Allow to configure websocket handshake interceptors #77

oscararias opened this issue Apr 6, 2020 · 1 comment

Comments

@oscararias
Copy link

Hi!

When working with subscriptions it would be useful to configure handshake interceptors like HttpSessionHandshakeInterceptor or other custom interceptors.

As for now, the only way I found of doing so was to opt-out of the whole websocket autoconfiguration. However, this could be achieved with a small change in the WebsocketAutoconfiguration class.

I did a very simple implementation that would perfectly work out for me, you can see it in this commit. Basically, I added a HandshakeInterceptorsFactory interface that can be implemented, if needed, to register interceptors.

I think this would be a good enhancement to the websocket autoconfiguration feature. Let me know your opinions.

Regards

@iamlothian
Copy link

I'm looking into something similar.

I am trying to secure web socket requests by introspecting the authorization header sent on the connection_init request and then populate the DefaultGlobalContext with the user session info.

'{"type":"connection_init","payload":{"Authorization":"bearer CbFKMklFnqKzj6xEFbw62y5EL9I"}}'

This is proving to be challenging, as I have to override a lot of the auto config beans to do this, which will make upgrading SPQR later difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants