Prevent multiple users to enter with the same JWT

Is there still no way of preventing multiple users from joining the same MUC with the same JWT?
This is just to prevent a user to join a conference with multiple instances using the same JWT.

Would this be achievable editing this function?

Thank you in advance.

Yes you can add a user context with user ID in the jwt and deny access when user is already there. You need to write that custom module. But when doing that mind that users will not be able to reconnect for a minute or two if they loose connection.

Can you provide a link to read more about this “user context”?

Ahh, I was generating the jwt using this https://jitok.emrah.com/, it already sets the context on the jwt.
My main problem is how to get a list of users that are already in the call in that pre-join event so I could make the verification?

You can get inspired by this: jitsi-meet/mod_filter_iq_rayo.lua at 0ad52a06ce1cfc2f3f7417551af972f9130edd81 · jitsi/jitsi-meet · GitHub
Searches all other rooms for a particular session, from each session you can get the session.jitsi_meet_context_user["id"] and check based on that.

1 Like

I’ll try! Thanks for always helping with examples and very rapidly!

Got it to work using an email field!!

One more thing, in the stanzas from the users in the rooms when I do the loop to check all rooms, there is the email field, it was injected into the stanza somehow, but I cannot find it where, I’d rather be using an ID. Do you happen to have an idea where this injection might happen?

In the presence as the initiator

That wasn’t quite what I meant, but I found this module, enabled it and got it to inject the presence stanza with the context. But somewhere there is a line of code injecting just the email on my prosody, I have yet to find it ahah

Anyway, thank you for your help!

I’ve managed to do what I wanted to, but actually what is the default time since a user loses internet connection until he is actually “kicked” out of the room? Do you know where we can configure that value?

For bosh that is 60 seconds and you can change it on server side, but for client side you need to rebuild one fo the dependencies of lib-jitsi-meet and use that to rebuild it.
You can change the websocket one both client side and serverside.