use "sub" instead of "aud" to confirm tenant domain settings

stick user and group from token context into session if available
This commit is contained in:
Aaron van Meerten 2017-07-11 22:06:47 -05:00 committed by Дамян Минков
parent 1ad614e812
commit fac6c30b1c
1 changed files with 13 additions and 1 deletions

View File

@ -226,7 +226,19 @@ function Util:process_and_verify_token(session)
-- Binds room name to the session which is later checked on MUC join -- Binds room name to the session which is later checked on MUC join
session.jitsi_meet_room = claims["room"]; session.jitsi_meet_room = claims["room"];
-- Binds domain name to the session -- Binds domain name to the session
session.jitsi_meet_domain = claims["aud"]; session.jitsi_meet_domain = claims["sub"];
-- Binds the user details to the session if available
if claims["context"] ~= nil then
if claims["context"]["user"] ~= nil then
session.jitsi_meet_context_user = claims["context"]["user"];
end
if claims["context"]["group"] ~= nil then
-- Binds any group details to the session
session.jitsi_meet_context_group = claims["context"]["group"];
end
end
return true; return true;
else else
return false, "not-allowed", msg; return false, "not-allowed", msg;