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

Jitsi: Simple way to join a jitsi room with a manual jwt token #13986

Closed
wants to merge 5 commits into from
Closed

Jitsi: Simple way to join a jitsi room with a manual jwt token #13986

wants to merge 5 commits into from

Conversation

aleixq
Copy link

@aleixq aleixq commented Jun 10, 2020

With a self-hosted jitsi server JWT tokens are the way to give access automatically and at same time protect against unauthorized guest room creation.
I found it useful to put in riot some way to enter the jwt token. By now obtaining the token is manually but I think that with some little work it can be done automatically. (notes below)

Mockup proposal about provide tokens automatically by the HS:

Maybe the better way should be to keep the secret (or the private key) to be able to generate jwt tokens in some way in matrix homeserver and then find a way to request jwt tokens to server (maybe widget api...), and answer with a token depending on the user power level.
Then at local widget level fill the jwt token field automatically, but only for the user who request the token or the widget and has a concrete power level.
Adding a jwt token url parameter for a jitsi that has not enabled it is harmless. So it can be always filled.
The jwt token field in riot widget (done in src/vector/jitsi/index.ts) will be the place to enter the token, if there's a good answer from server then fill it, if not leave blank.

Also, by now a simple bot could be used by now to request the jwt token.

But as I said by now the homeserver part is not there, so we only can create room jwt tokens manually by the one who has the secret or the allowed private key.

It's my first contribution in riot so i don't know if the PR is fully usable, i think so, but maybe the use of localstorage from the widget is not recommended, or maybe it's better to use indexeddb... Excuse me if I omit something.

@t3chguy
Copy link
Member

t3chguy commented Jun 10, 2020

Maybe the better way should be to keep the secret (or the private key) to be able to generate jwt tokens in some way in matrix homeserver

How would this work given any Riot can use any Jitsi via config.json?

Adding a jwt token url parameter for a jitsi that has not enabled it is harmless.

Yes but the field always being there has the chance to confuse simpler users.

@t3chguy t3chguy requested a review from a team June 10, 2020 23:03
@aleixq
Copy link
Author

aleixq commented Jun 11, 2020

Maybe the better way should be to keep the secret (or the private key) to be able to generate jwt tokens in some way in matrix homeserver

How would this work given any Riot can use any Jitsi via config.json?

Well Maybe it's my fault to mix issues, and plan the server part out of riot issues. But I think that various jitsi servers keys can be defined, specified in a list of domain:secret or domain:private_key. If a user sends a token request to server and the server doesn't contain the specified domain then it will return an error code and so on the field will not be succesfully filled.
As example of a JWT token implementation is how Rocket has done it: not valid in matrix case as they use the secret in the client side, and it means giving secrets and power to create any jitsi room to any room moderator...:
https://medium.com/@szewong/rocket-chat-part-3-installing-jitsi-with-jwt-for-secure-video-conferencing-b6f909e7f92c
https://github.com/RocketChat/Rocket.Chat/pull/12259/files/f3e2ca623fda7531d830e85aa86d4601c4065ec7

Adding a jwt token url parameter for a jitsi that has not enabled it is harmless.

Yes but the field always being there has the chance to confuse simpler users.

That's why I put in a details element... Maybe it is still confusing... but given the importance of allowing moderated and "private" jitsi rooms I think is better this than just left it out of riot, making users to detach jitsi in a new window and add the jwt get parameter there.

@jryans
Copy link
Collaborator

jryans commented Jun 23, 2020

@aleixq, thanks for your interest in this feature and working on this PR.

I agree it would be good to offer private / authenticated calls in Riot, but I am worried this approach is too power user focused, and would degrade the UX for the common case. For a feature like this, I think we'll need to work together with the Riot Design team from the start to ensure the overall UX is consider holistically across different user types, so we can ensure we're offering privacy and security that's also simple to use.

At the moment, the Design team has a lot on their plate with several first-time user experience projects all coming together soon, so if you're still interested in pursuing this topic, I'd recommend discussing it with the team first in #riot-web:matrix.org, perhaps in a few weeks from now once we're past the current slate of work.

@jryans jryans closed this Jun 23, 2020
@jryans jryans removed the request for review from a team June 23, 2020 10:59
@aleixq
Copy link
Author

aleixq commented Jun 25, 2020

Well thanks @jryans , I have sent a message in that room. But, do you think that it will be useful to open a new issue as a feature request?

@jryans
Copy link
Collaborator

jryans commented Jun 25, 2020

do you think that it will be useful to open a new issue as a feature request?

Yes, feel free to open an issue and describe your use case in detail. That will help us track interest and prioritise future work. 😄

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

Successfully merging this pull request may close these issues.

3 participants