Unable to load module "token_verification" - Configuring JWT tokens with Jitsi meet

I was following this documentation https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md
This is log from my prosody.log file

Apr 13 08:36:34 modulemanager   error   Unable to load module 'muc_domain_mapper': /usr/lib/prosody/modules/mod_muc_domain_mapper.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'muc_meeting_id': /usr/lib/prosody/modules/mod_muc_meeting_id.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'token_verification': /usr/lib/prosody/modules/mod_token_verification.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'auth_token': /usr/lib/prosody/modules/mod_auth_token.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'conference_duration': /usr/lib/prosody/modules/mod_conference_duration.lua: No such file or directory
Apr 13 08:36:34 portmanager     error   Error binding encrypted port for https: No key present in SSL/TLS configuration for https port 5281
Apr 13 08:36:34 portmanager     error   Error binding encrypted port for https: No key present in SSL/TLS configuration for https port 5281
Apr 13 08:36:34 modulemanager   error   Unable to load module 'vcard_legacy': /usr/lib/prosody/modules/mod_vcard_legacy.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'speakerstats': /usr/lib/prosody/modules/mod_speakerstats.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'presence_identity': /usr/lib/prosody/modules/mod_presence_identity.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'vcard4': /usr/lib/prosody/modules/mod_vcard4.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'turncredentials': /usr/lib/prosody/modules/mod_turncredentials.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'vcard_legacy': /usr/lib/prosody/modules/mod_vcard_legacy.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'vcard4': /usr/lib/prosody/modules/mod_vcard4.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'token_verification': /usr/lib/prosody/modules/mod_token_verification.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'speakerstats_component': /usr/lib/prosody/modules/mod_speakerstats_component.lua: No such file or directory
Apr 13 08:36:34 modulemanager   error   Unable to load module 'conference_duration_component': /usr/lib/prosody/modules/mod_conference_duration_component.lua: No such file or directory
Apr 13 08:36:34 certmanager     error   SSL/TLS: Failed to load '/etc/prosody/certs/localhost.key': Check that the permissions allow Prosody to read this file. (for localhost)
Apr 13 08:36:34 localhost:tls   error   Error creating context for c2s: error loading private key (Permission denied)
Apr 13 08:36:34 certmanager     error   SSL/TLS: Failed to load '/etc/prosody/certs/localhost.key': Previous error (see logs), or other system error. (for localhost)
Apr 13 08:36:34 localhost:tls   error   Error creating contexts for s2sout: error loading private key (system lib)
Apr 13 08:36:34 certmanager     error   SSL/TLS: Failed to load '/etc/prosody/certs/localhost.key': Previous error (see logs), or other system error. (for localhost)
Apr 13 08:36:34 localhost:tls   error   Error creating contexts for s2sin: error loading private key (system lib)
Apr 13 08:36:34 modulemanager   error   Unable to load module 'vcard_legacy': /usr/lib/prosody/modules/mod_vcard_legacy.lua: No such file or directory

If you are using Jitsi’s Debian packages… Did you install “jitsi-meet-prosody”?
Has your domain configuration in prosody this line?:
plugin_paths = { “/usr/share/jitsi-meet/prosody-plugins/” }
Something is wrong with your prosody configuration, it’s not even loading prosody’s default modules:

Apr 13 08:36:34 modulemanager   error   Unable to load module 'vcard_legacy': /usr/lib/prosody/modules/mod_vcard_legacy.lua: No such file or directory
1 Like

@agi, I think jitsi-meet-prosody is already installed, when i run apt-get instal jitsi-meet-prosody. it shows already updated to newest version.

And i am already configured this line in /etc/prosody/prosody.cfg.lua file.

Screenshot 2020-04-13 at 2.41.20 PM

Hi, the main prosody configuration (prosody.cfg.lua) shoud contain prosody’s modules path:

plugin_paths = { “/usr/local/lib/prosody/modules” }

While your domain’s config (/etc/prosody/conf-available/YOURDOMAIN.cfg.lua) should add Jitsi’s:

plugin_paths = { “/usr/share/jitsi-meet/prosody-plugins/” }

1 Like

@agi

Thanks, After adding this line in my /etc/prosody/conf-available/YOURDOMAIN.cfg.lua

I am getting a prompt to enter username and password to join any call, if i pass my jwt token like this

https://sub.website.com?jwt=TOKEN_HERE

I am getting this error

Maybe, my token is wrong? i create it from jwt.io

Can you please help me with troubleshooting this?

This is my config data:

VirtualHost "sub.website.com"
        -- enabled = false -- Remove this line to enable this host
        authentication = "token";
        -- Properties below are modified by jitsi-meet-tokens package config
        -- and authentication above is switched to "token"
        app_id="example_app_id";
        app_secret="supersecret";
        allow_empty_token = false;

And my token structure is this

{
“context”: {
“user”: {
“avatar”: “https:/gravatar.com/avatar/abc123”,
“name”: “John Doe”,
“email”: “jdoe@example.com
}
},
“aud”: “example_app_id”,
“iss”: “example_app_id”,
“sub”: “sub.website.com”,
“room”: “*”,
“exp”: 1586943166
}

Final link to authorize user is https://sub.website.com/?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb250ZXh0Ijp7InVzZXIiOnsiYXZhdGFyIjoiaHR0cHM6L2dyYXZhdGFyLmNvbS9hdmF0YXIvYWJjMTIzIiwibmFtZSI6IkpvaG4gRG9lIiwiZW1haWwiOiJqZG9lQGV4YW1wbGUuY29tIn19LCJhdWQiOiJleGFtcGxlX2FwcF9pZCIsImlzcyI6ImV4YW1wbGVfYXBwX2lkIiwic3ViIjoiY2FsbC5lZHZvaWQuY29tIiwicm9vbSI6IioiLCJleHAiOjE1ODY5NDMxNjZ9.rV2hPHRGl13AzyADrkekRa9RiYllpYbAan7sbP9AH1w

Can you please help me with this issue ?

I’m sorry but I’m not an expert on this. I would keep checking your logs (both prosody’s and jicofo’s) to see if there’s something wrong with the setup. Good luck!

1 Like

I created the follow doc to install Jitsi Meet (with new JVB2) and Jitsi meet tokens in ubuntu 18.04, it’s working perfectly

Jitsi Installation Doc

2 Likes

@Mike_Christian thanks for your effort :grinning: I’ll check it, and I’ll post updates here.

None of the answers worked, and after few months i found a great solution.

This is more detailed answer and it works 100% for most of the guys and it also worked for me https://github.com/jitsi/lib-jitsi-meet/issues/1082#issuecomment-616948457 don’t forget to thank this guy after solving your issue :slight_smile: