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

Support OAUTHBEARER SASL mechanism in HonoClient and service implementations #530

Open
sophokles73 opened this issue Mar 12, 2018 · 5 comments

Comments

@sophokles73
Copy link
Contributor

sophokles73 commented Mar 12, 2018

Currently, components authenticate each other based on SASL PLAIN. However, under the hood, the server components forward the credentials provided by the client to Hono Auth in order to retrieve a JWT asserting the client's identity and authorities.

This mechanism has the big drawback of requiring the server to close the connection with the client once the token expires in order to trigger the client to start a new SASL handshake so that the server can retrieve a new token from Hono Auth.

It seems more desirable to allow the client to authenticate using a token in the first place. This way, the client can also refresh the token on its own behalf and update the token on the server over the (still) existing connection using e.g. AMQP 1.0 Claims based Security.

See A Set of Simple Authentication and Security Layer (SASL) Mechanisms for OAuth

@avgustinmm
Copy link
Contributor

I stuck into the same issue. I'm not sure how the adapter using HonoClient should react in this case (if the hono client doesn't handle this by itself).
First of all the problem is not directly visible - e.g. it is hard to be identified if there is authentication issue or something else as a problem. Then, even I find out that I should re-establish clients then I should do this while having many messages to send (I don't want to return errors to device and left it to handle that - not a nice for device. It may not be able to handle it). Since I do sending in multiple thread I should some how sync the re-establishment of the new client, make all send actions to wait for this single re-establishment. This is a complex task to be made effectively and safe.
At the end I'd vote for this re-authentication to be handled invisibly in the HonoClient.

@sophokles73
Copy link
Contributor Author

I don't want to return errors to device and left it to handle that - not a nice for device. It may not be able to handle it

They will need to be able to handle such errors in any case because the protocol adapter might not be able to reconnect at all. Or the protocol adapter instance might be shut down and re-scheduled to another node by Kubernetes.

@avgustinmm
Copy link
Contributor

They may just give up in this case. So, the adapter should do its best to handle the events without returning them to device. Of course 100% guaranty form the adapter side is not possible.

@sysexcontrol sysexcontrol added this to the 0.9 milestone Nov 29, 2018
@sophokles73 sophokles73 modified the milestones: 0.9, 1.0.0 Feb 26, 2019
@Alfusainey
Copy link
Contributor

Alfusainey commented Jul 8, 2019

@sophokles73 I want to take a look into this but is wondering if its still an issue?

@sophokles73
Copy link
Contributor Author

@Alfusainey it is currently not a priority for me. However, if you would like to work on it, be my guest ...

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

No branches or pull requests

4 participants