How get access to content of JWT token in custom module?

I use JWT token auth and I try write simple module, which use content from field of JWT token.

local st = require "util.stanza";
local jid = require "util.jid";
local nodeprep = require "util.encodings".stringprep.nodeprep;
module:hook("muc-room-created", function(event)
    local origin, stanza = event.origin, event.stanza;
    module:log("info", "token: %s, room: %s", tostring(origin.auth_token), tostring(origin.jitsi_meet_room))
end, 10);

I connect to room with token, in prosody logs I see token is nil:

prosody_1  |   info	token: nil, room: nil

How I can get token ?

This one gets the token from the session and checks some stuff there

Thank you for answer, but I copypaste code:

    local session = event.origin;
    local token = session.auth_token;
    module:log("info", "TEST session token %s)", tostring(token))

And this code give me nil:

prosody_1  |    info	TEST session token nil)

hi @Evg I have same problem with you. Did you solve your issue ?

This module help me:

I use it too. But doesn’t work. I try enable confing

enableUserRolesBasedOnToken: true,
enableFeaturesBasedOnToken: true,
lockRoomGuestEnabled: true,

I try to past token with . All user join with token will be as a moderator? Is that true?


I try join with jwt but I didn’t become moderator. Did I miss some config for this? @damencho