How do I prevent two users with the same JWT from logging in?

Hello, I create JWT tokens with a unique ID for each token and pass them to jitsi meet.
I want to prevent two users with the same JWT id to login.
Is this possible?

Sample JWT token:

{
  "iss": "2abd469fed1bac30cd28c9bf",
  "sub": "***********",
  "iat": 1645279678,
  "nbf": 1645279678,
  "exp": 1645283278,
  "aud": "abcd",
  "moderator": true,
  "room": "*********",
  "context": {
    "user": {
      "name": "Test",
      "email": "abcd@xyz.com",
      "id": "ZDbgT8TTqrHENG3FF",
      "rid": "TestRoom"
    }
  }
}

There is no such feature, but it is possible with custom prosody modules.
For example this checks for outgoing calls initiated by the same user in other rooms, you can use it as an example to look for the same user connected to another room,

Thank you for the reply, I forgot to mention that I want to prevent two users with the same JWT id from logging into the same room. (The participants might get the same ID because one participant can share his link to the other)

People should not be sharing their jwt.

Yeah, I wanted to prevent the sharing of links between participants in the first place. I tried it but had no luck and so I want to prevent it in Jitsi meet by identifying the JWT ID and prohibiting them to join the meeting.

Could you please help me in doing this?

@damencho Can you please guide me on what function to modify in prosody to validate the duplicate JWTs and get the list of the participants present in the room that the user is trying to join?

You need to create your own custom module and implement your logic there.
You can start from here Developing Prosody modules – Prosody IM
and then use the example I provided to implement your logic.

Thank You @damencho. I am able to find that the verification of JWT happens in “token/util.lib.lua” in the “verify_room” function. Can you help me to get the list of participants in the room?

P.S:- I have no Idea about prosody… Please help

Have you checked the link I sent earlier?

Yes, I have checked it @damencho. Can you help me with where to insert that code?
I don’t have knowledge about prosody so I am sorry if I am troubling you.

This doesn’t seem like a simple help request. You ask someone to code your specific requirement for free.

@emrah If you don’t mind, could you please code it for me?

This is a request you can put in the paid section in the forum.