From 573cc64fcd66e486fb56f2d105ddb9c17bdac88b Mon Sep 17 00:00:00 2001 From: jmacelroy <30531294+jmacelroy@users.noreply.github.com> Date: Fri, 1 Feb 2019 13:19:33 -0600 Subject: [PATCH] Normalizing subdomain when checking JWTs; similar to room. --- resources/prosody-plugins/token/util.lib.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/prosody-plugins/token/util.lib.lua b/resources/prosody-plugins/token/util.lib.lua index 72df4ec8a..a949814ad 100644 --- a/resources/prosody-plugins/token/util.lib.lua +++ b/resources/prosody-plugins/token/util.lib.lua @@ -379,7 +379,7 @@ function Util:verify_room(session, room_address) end return room_address_to_verify == jid.join( - "["..subdomain_to_check.."]"..string.lower(room_to_check), self.muc_domain); + "["..string.lower(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 @@ -391,7 +391,7 @@ function Util:verify_room(session, room_address) -- we do not have a domain part (multidomain is not enabled) -- verify with info from the token return room_address_to_verify == jid.join( - string.lower(room_to_check), subdomain_to_check); + string.lower(room_to_check), string.lower(subdomain_to_check)); end end