Skip to content

Commit

Permalink
use "sub" instead of "aud" to confirm tenant domain settings
Browse files Browse the repository at this point in the history
stick user and group from token context into session if available
  • Loading branch information
Aaron van Meerten authored and damencho committed Jul 12, 2017
1 parent 1ad614e commit fac6c30
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion resources/prosody-plugins/token/util.lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,19 @@ function Util:process_and_verify_token(session)
-- Binds room name to the session which is later checked on MUC join
session.jitsi_meet_room = claims["room"];
-- 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;
else
return false, "not-allowed", msg;
Expand Down

0 comments on commit fac6c30

Please sign in to comment.