Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
supports a '*' in the sub claim to allow access to any room
Aaron van Meerten13165990fce9
diff --git a/resources/prosody-plugins/token/util.lib.lua b/resources/prosody-plugins/token/util.lib.luaindex f9577687a5..72df4ec8a4 100644--- a/resources/prosody-plugins/token/util.lib.lua+++ b/resources/prosody-plugins/token/util.lib.lua@@ -357,11 +357,20 @@ function Util:verify_room(session, room_address)room_to_check = room_node;endelse+ -- no wildcard, so check room against authorized room in tokenroom_to_check = auth_room;endlocal auth_domain = session.jitsi_meet_domain;+ local subdomain_to_check;if target_subdomain then+ if auth_domain == '*' then+ -- check for wildcard in JWT claim, allow access if found+ subdomain_to_check = target_subdomain;+ else+ -- no wildcard in JWT claim, so check subdomain against sub in token+ subdomain_to_check = auth_domain;+ end-- from this point we depend on muc_domain_base,-- deny access if option is missingif not self.muc_domain_base then@@ -370,12 +379,19 @@ function Util:verify_room(session, room_address)endreturn room_address_to_verify == jid.join(- "["..auth_domain.."]"..string.lower(room_to_check), self.muc_domain);+ "["..subdomain_to_check.."]"..string.lower(room_to_check), self.muc_domain);else+ if auth_domain == '*' then+ -- check for wildcard in JWT claim, allow access if found+ subdomain_to_check = self.muc_domain;+ else+ -- no wildcard in JWT claim, so check subdomain against sub in token+ subdomain_to_check = self.muc_domain_prefix.."."..auth_domain;+ end-- we do not have a domain part (multidomain is not enabled)-- verify with info from the tokenreturn room_address_to_verify == jid.join(- string.lower(room_to_check), self.muc_domain_prefix.."."..auth_domain);+ string.lower(room_to_check), subdomain_to_check);endend