[lib-jitsi-meet] [prosody] Problem with presence_identity plugin and JWT data retrieved

Hi everyone,

We are building our Jitsi meet custom client using lib-jitsi-meet.
We integrated prosody enabling JWT token authentication to do some custom stuff in the client.
We are also setting Jibri up to enable the recording.

The Prosody plugin module “mod_presence_identity” should pass both “group” and “user” information from the jwt token but instead, in the “metadata.json” file created by Jibri we find only “avatar, name, and id” inside the “user” field.

The same thing applies to the data received by the “conference” in the client.

For example, from this token:

{
  "context": {
    "user": {
      "avatar": "https:/gravatar.com/avatar/abc123",
      "name": "Pinco Pallino",
      "email": "jdoe@example.com",
      "id": "abcd:a1b2c3-d4e5f6-0abc1-23de-abcdef01fedcba"
    },
    "isHidden": true,
    "group": "a123-123-456-789"
  },
  "aud": "jitsi",
  "iss": "my_client",
  "sub": "meet-test.test.it",
  "room": "*"
}

we receive only:

group: {
  "a123-123-456-789"
}
user: { 
  avatar: "https:/gravatar.com/avatar/abc123"
  id: "abcd:a1b2c3-d4e5f6-0abc1-23de-abcdef01fedcba"
  name: "Pinco Pallino"
}

Is this a problem with prosody or is it considered normal behavior?

If this is normal behavior, how can we customize prosody to send custom data regarding the user?

Thanks in advance!

It should be coping the user part and just add a group and pass it through, you can debug or add more here: https://github.com/jitsi/jitsi-meet/blob/master/resources/prosody-plugins/util.lib.lua#L144

Thank you Damencho for your fast reply, I’m a colleague of Giamme.

I tried to add in file util.lib.lua some debug logs useful to help us understand what is happening during the update of a presence identity. In detail:

163     for k, v in pairs(user) do
164         module:log("info", ">> %s, %s", tostring(k), tostring(v));
165         stanza:tag(k):text(v):up();
166     end

As a result, I was able to see every updated entry for “user” information, and in fact the log result is:

Oct 01 16:12:38 meet.hostname.it:presence_identity info    >> avatar, https:/gravatar.com/avatar/abc123
Oct 01 16:12:38 meet.hostname.it:presence_identity info    >> email, jdoe@example.com
Oct 01 16:12:38 meet.hostname.it:presence_identity info    >> test, custom
Oct 01 16:12:38 meet.hostname.it:presence_identity info    >> id, abcd:a1b2c3-d4e5f6-0abc1-23de-abcdef01fedcba
Oct 01 16:12:38 meet.hostname.it:presence_identity info    >> name, John Doe

As you can see there is both the email and an extra parameter we added in the JWT token, along with the other information.

Unfortunately, when I start and complete a new recording with Jibri, this is the resulting metadata.json that I find beside the recording.mp4 in the folder /tmp/recordings/randomletters/:

{"meeting_url":"https://meet.hostname.it/test",
    "participants":[ {
        "group":"a123-123-456-789",
        "user":{
            "avatar":"https:/gravatar.com/avatar/abc123",
            "id":"abcd:a1b2c3-d4e5f6-0abc1-23de-abcdef01fedcba",
            "name":"John Doe"
        }
    }],
    "share":true
}

As you can see, both “email” and “test” keys are missing.

Can you please help me find the piece of code that produces the previously cited “metadata.json” so that I can try and debug there what’s happening with the rest of the information?

Thank you very much for your time

Here is your problem: https://github.com/jitsi/lib-jitsi-meet/blob/master/modules/xmpp/ChatRoom.js#L482

3 Likes

You sir, just saved the day! Thank you very much for this precise help!

1 Like

What an answer! Precise and concise!
Thank you very much for your