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 Server.observe with authenticated peer #361

Open
ScottErholm opened this issue Dec 11, 2017 · 2 comments
Open

Allow Server.observe with authenticated peer #361

ScottErholm opened this issue Dec 11, 2017 · 2 comments

Comments

@ScottErholm
Copy link

If peer linking is authenticated, there is no mechanism to propagate the authentication to the receiver. This means there is no way for the receiving link to complete a peer.subscribe, which results in a failure for Server.observe.

Suggest communicating the authorization in the response header at the checkServerReq request handler.

@AdamMagaluk
Copy link
Collaborator

Do you have a simple example you can provide? How are you doing authentication during the peering?

@ScottErholm
Copy link
Author

Any HTTP authentication scheme could be used, but for simplicity I'll just consider Basic.

Things start out normally, with the initiating peer supplying a username/password to authenticate with the receiver. But then later the receiver must authenticate back to the initiator, which is a little backwards.

It seems there are two ways to handle this: 1. Configure the receiving server with the necessary information to authenticate with any and every initiating peer which may or may not make a link, or 2. After the initiating peer has successfully authenticated with the receiver, it then passes credentials to the receiver so that the receiver can later subscribe.

The 2nd option makes more sense to me, and the credentials can be passed to the receiver as the last step of the peer connection in checkServerReq.

Most of the actual work can be done in extensions using onPeerRequest, onPeerResponse, onPeerConnect, and onEventWebsocketConnect. It's really nice that all these hooks are already in place.

Maybe there is a better way to securely subscribe that I'm not seeing. I did want to run it by people here before making a pull request.

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