[
https://issues.apache.org/jira/browse/QPIDJMS-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16426753#comment-16426753
]
Robbie Gemmell commented on QPIDJMS-373:
----------------------------------------
Creating your own transport factory is what I was describing, yes. You could
have one that simply wrapped the existing bits and did nothing but
provide/update the details for the header.
Writing a delegating ConnectionFactory of your own as Rob mentioned would be
quite simple I'd think. It would implement the createConnection calls, have
them get a token, and then call the createConnection methods of the underlying
factory accordingly.
Failover is an interesting point in that case though, as if a new token was
needed at every attempt then the application would need to manage that
reconnection itself by using the factory, e.g as many frameworks actually do,
rather than using the connections 'internal' functionality. Doing otherwise
would need the wrapping factory to be notified of the reconnection and update
the token used somehow. There is a listener callback on the connection impl
(mostly used for testing) that notifies of such activity that could be used,
though it is called asynchronously and getting the updated details where needed
wouldn't currently be possible except maybe by using reflection.
Registering a callback when creating the original factory is perhaps something
I could live with. We previously added ability to pass through an SSLContext
from the factory to use during connection, that mechanism could perhaps be
generalised to carry other things for transport impls to utilise at connect,
such as a way to get the auth header value to use.
> Support for OAuth flow and setting of "Authorization" Header for WS upgrade
> request
> -----------------------------------------------------------------------------------
>
> Key: QPIDJMS-373
> URL: https://issues.apache.org/jira/browse/QPIDJMS-373
> Project: Qpid JMS
> Issue Type: New Feature
> Components: qpid-jms-client
> Reporter: Michael Bolz
> Priority: Major
>
> Add support for OAuth flow ("client_credentials" and "password") and setting
> of "Authorization" Header during WebSocket connection handshake.
> Used "Authorization" Header or OAuth settings should/could be set via the
> "transport" parameters (TransportOptions).
>
> As PoC I created a [Fork|https://github.com/mibo/qpid-jms/tree/ws_add_header]
> and have done one commit for the [add of the Authorization
> Header|https://github.com/mibo/qpid-jms/commit/711052f0891556db0da6e7d68908b2f9dafadede]
> and one commit for the [OAuth
> flow|https://github.com/mibo/qpid-jms/commit/de70f0d3e4441358a239b3e776455201c133895d].
>
> Hope this feature is not only interesting for me.
> If yes, I will add the currently missing tests to my contribution and do a
> pull request.
>
> Regards, Michael
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]