Websocket servlet filter to fake JWT token in auth header #28762
-
Since whatwg refuses to add custom authorization header support to the browser WebSocket API spec I am forced to pass my JWT token as a query string when connecting to WS server. I still wanted to retain a shred of decency and use So I wanted to be clever and write a Servlet Filter which would transform incoming query param into Authorization: Bearer header with highest priority (before security kicks in). Any idea or hack workaround how to achieve this? I want manual JWT auth check only as last resort. The saddest thing is that using non-browser WS implementation (e.g node) that support adding custom headers to WS handshake, everything just works beautifully out of the box. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
/cc @sberyozkin |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@cen1 So in your original description you said you were looking for |
Beta Was this translation helpful? Give feedback.
@cen1 So in your original description you said you were looking for
Any idea or hack workaround how to achieve this
... So wouldn't using a subprotocol field to pass the token qualify as a hack ? Other than that I can only think about the custom WS bindings which could be use to keep the token around but I'm not sure how it can be implemented at the Quarkus level, perhaps we need an enhancement PR