This plugin sets the occupant's affiliation according to the token content.
-
Copy this script to the Prosody plugins folder. It's the following folder on Debian:
cd /usr/share/jitsi-meet/prosody-plugins/ wget -O mod_token_affiliation.lua https://raw.githubusercontent.com/jitsi-contrib/prosody-plugins/main/token_affiliation/mod_token_affiliation.lua
-
Enable module in your prosody config.
/etc/prosody/conf.d/meet.mydomain.com.cfg.lua
Component "conference.meet.mydomain.com" "muc" modules_enabled = { "token_verification"; "token_affiliation";
-
Disable auto-ownership on Jicofo and let the module set the affiliations according to the token content.
hocon -f /etc/jitsi/jicofo/jicofo.conf \ set jicofo.conference.enable-auto-owner false
-
Restart the services
systemctl restart prosody.service systemctl restart jicofo.service
Set affiliation
in token. The value may be owner
or member
.
A sample token body:
{
"aud": "myapp",
"iss": "myapp",
"sub": "meet.mydomain.com",
"iat": 1601366000,
"exp": 1601366180,
"room": "*",
"context": {
"user": {
"name": "myname",
"email": "[email protected]",
"affiliation": "owner"
}
}
}
You may create test tokens on jitok.