yjs / y-webrtc

WebRTC Connector for Yjs
MIT License
448 stars 109 forks source link

Use Authentication for allowing/blocking access #40

Open junoriosity opened 1 year ago

junoriosity commented 1 year ago

I like the signaling server you provide at https://github.com/yjs/y-webrtc/blob/master/bin/server.js, yet I think it makes sense for me to provide it with some authorization depending on a provided JWT token within the request. I think I know that I would have to provide such a thing at https://github.com/yjs/y-webrtc/blob/master/bin/server.js#L127. However, I do not know when I call

const provider = new WebrtcProvider('your-room-name', ydoc, { password: 'optional-room-password' })

or so, where I can send the JWT token in the request.

It would be great if you could help me here.

junoriosity commented 1 year ago

Would be great if I could get some support here, as I am not an expert on that matter 😀