How can I enable Shared Screen for Moderators using JWT?

I have Jitsi Meet with JWT tokens enabled and working.
Everything is great except Shared Screen (Desktop) functionality for moderators is disabled.

If I set “enableFeaturesBasedOnToken: false;” in the config file, shared screen works for all users as expected.

If I set “enableFeaturesBasedOnToken: true”

Guest are shown, “Guest can’t share share” (which is expected)
Moderator is shown " Share Screen Disabled" (not expected)

How can I enable shared screen to work for moderators only with enableFeaturesBasedOnToken: true?

I did the quick install + JWT setup +

My versions

ii jitsi-meet 2.0.5142-1
ii jitsi-meet-prosody 1.0.4466-1
ii jitsi-meet-turnserver 1.0.4466-1
Meet
ii jitsi-meet-web 1.0.4466-1
ii jitsi-meet-web-config 1.0.4466-1
Meet
ii jitsi-videobridge2 2.1-376-g9f12bfe2-1

Have you added in jwt token the feature ‘screen-sharing’?

Thank you for quick reply.

Do you mean on the token itself? I just tried the following


“room”: “*”,
“screen-sharing”: true,
“moderator”: true
}

Unfortunately, I’m still seeing the Share Screen Disabled message for the moderator.

Does screen-sharing’ need to go somewhere else?

Nope, that should be in

"context": {
....
    "features": {
        “screen-sharing”: true
   }
}

Thanks, Damencho.

I tried that too. Unfortunately, that still didn’t work. I tried a hard refresh just incase, but it’s still showing “Share Screen Disabled”.

Here’s the full JWT payload.

{
“context”: {
“users”:{
“name”: “Moderator”
},
“features”: {
“screen-sharing”: true
}
},
“aud”: “xxxxxxx”,
“iss”: “xxxxxxxx”,
“sub”: “xxxxxxxx”,
“room”: “*”,
“moderator”: true
}

With the token, I’m able to start the meeting, mute all users, kick a user out, etc… It’s only Share Screen that is disabled.

Am I still structuring the token wrong for “screen-sharing”?

I checked the following page and few others but didn’t see anything regarding features and tokens:

Yeah that had not been used a lot … and no docs for this feature … Need to test it and debug js why it does not respect it …

Thanks. I really appreciate it. If you need anything, please let me know.

users” should be “user

screen-sharing” works for me.

  • the latest stable
  • the token content (screen-sharing) is same with your example
  • I didn’t test with token_moderation, I have token_affiliation

Thanks, Emrah.

Odd, I tried your script too… I’m still getting the disabled message for shared desktop.

Do you have the following in your config?

enableUserRolesBasedOnToken: true,
enableFeaturesBasedOnToken: true,

yes, both of them are true

This is a working token

{
  "aud": "myapp",
  "iss": "myapp",
  "sub": "meet.mydomain.com",
  "exp": 1604566635,
  "room": "test-1234",
  "context": {
    "user": {
      "name": "myname",
      "email": "myemail@gmail.com",
      "avatar": "https://gravatar.com/avatar/abc123.png",
      "affiliation": "owner"
    },
    "features": {
      "recording": true,
      "livestreaming": true,
      "screen-sharing": true
    }
  }
}

and the link

https://meet.mydomain.com/test-1234?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJteWFwcCIsImlzcyI6Im15YXBwIiwic3ViIjoibWVldC5teWRvbWFpbi5jb20iLCJleHAiOjE2MDQ1NjY2MzUsInJvb20iOiJ0ZXN0LTEyMzQiLCJjb250ZXh0Ijp7InVzZXIiOnsibmFtZSI6Im15bmFtZSIsImVtYWlsIjoibXllbWFpbEBnbWFpbC5jb20iLCJhdmF0YXIiOiJodHRwczpcL1wvZ3JhdmF0YXIuY29tXC9hdmF0YXJcL2FiYzEyMy5wbmciLCJhZmZpbGlhdGlvbiI6Im93bmVyIn0sImZlYXR1cmVzIjp7InJlY29yZGluZyI6dHJ1ZSwibGl2ZXN0cmVhbWluZyI6dHJ1ZSwic2NyZWVuLXNoYXJpbmciOnRydWV9fX0.Do1iIGwI7e2lff-7k3rRrn0B5V-KQnygaWThZg4OMAY
1 Like

There may be a browser issue too. Try private window or incognito window

1 Like

Solved!

Emrah, you were correct… it was the “users” in the token then a hard refresh to clear my cache.
Everything works now.

Thank you for your help.

1 Like

Emrah, have you find features options somewhere?
I want to activate or disable other features but I don’t find any list to know which features I can edit.

Thanks.