Jitsi-meet or prosody doesn't work after enable authentication token

Hello everyone!
Today i installed jitsi-meet in my server, installation was success, but in my project I should apply token verification,
I used this guide https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md, I applied all changes on my configs, but at the moment of enter in a room prosody error logs get this error:

warn No available SASL mechanisms, verify that the configured authentication module is working

in jicofo logs get this when i initialized prosody service

Hello everyone!
Today was installed jitsi-meet in my server, installation was success, but in my project I should apply token verification,
I used this guide https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md , I apply all changes on my configs, but at the moment of enter in a room prosody error logs get this error:

warn No available SASL mechanisms, verify that the configured authentication module is working

prosody error log get this:

Aug 12 19:22:20 modulemanager	error	Error initializing module 'auth_token' on 'jitsi.server.name': /usr/lib/prosody/util/startup.lua:199: module 'basexx' not found:Failed loading module basexx in LuaRocks rock basexx 0.4.1-1
	no field package.preload['basexx']
	no file '/usr/lib/prosody/basexx.lua'
	no file '/usr/local/share/lua/5.2/basexx.lua'
	no file '/usr/local/share/lua/5.2/basexx/init.lua'
	no file '/usr/local/lib/lua/5.2/basexx.lua'
	no file '/usr/local/lib/lua/5.2/basexx/init.lua'
	no file '/usr/share/lua/5.2/basexx.lua'
	no file '/usr/share/lua/5.2/basexx/init.lua'
	no file '/var/lib/prosody/.luarocks/share/lua/5.2/basexx.lua'
	no file '/var/lib/prosody/.luarocks/share/lua/5.2/basexx/init.lua'
	no file '/usr/lib/prosody/basexx.so'
	no file '/usr/local/lib/lua/5.2/basexx.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.2/basexx.so'
	no file '/usr/lib/lua/5.2/basexx.so'
	no file '/usr/local/lib/lua/5.2/loadall.so'
	no file '/var/lib/prosody/.luarocks/lib/lua/5.2/basexx.so'
stack traceback:
	[C]: in function '_real_require'
	/usr/lib/prosody/util/startup.lua:199: in function 'require'
	/usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:4: in main chunk
	(...tail calls...)
	/usr/share/jitsi-meet/prosody-plugins/mod_auth_token.lua:8: in main chunk
	[C]: in function 'xpcall'
	/usr/lib/prosody/core/modulemanager.lua:183: in function 'do_load_module'
	/usr/lib/prosody/core/modulemanager.lua:261: in function 'load'
	/usr/lib/prosody/core/usermanager.lua:67: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/core/hostmanager.lua:108: in function 'activate'
	/usr/lib/prosody/core/hostmanager.lua:58: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/util/startup.lua:391: in function 'prepare_to_start'
	/usr/lib/prosody/util/startup.lua:613: in function 'f'
	/usr/lib/prosody/util/async.lua:139: in function 'func'
	/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>
Aug 12 19:22:20 modulemanager	error	Error initializing module 'token_verification' on 'jitsi.server.name': /usr/lib/prosody/util/startup.lua:199: module 'basexx' not found:Failed loading module basexx in LuaRocks rock basexx 0.4.1-1
	no field package.preload['basexx']
	no file '/usr/lib/prosody/basexx.lua'
	no file '/usr/local/share/lua/5.2/basexx.lua'
	no file '/usr/local/share/lua/5.2/basexx/init.lua'
	no file '/usr/local/lib/lua/5.2/basexx.lua'
	no file '/usr/local/lib/lua/5.2/basexx/init.lua'
	no file '/usr/share/lua/5.2/basexx.lua'
	no file '/usr/share/lua/5.2/basexx/init.lua'
	no file '/var/lib/prosody/.luarocks/share/lua/5.2/basexx.lua'
	no file '/var/lib/prosody/.luarocks/share/lua/5.2/basexx/init.lua'
	no file '/usr/lib/prosody/basexx.so'
	no file '/usr/local/lib/lua/5.2/basexx.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.2/basexx.so'
	no file '/usr/lib/lua/5.2/basexx.so'
	no file '/usr/local/lib/lua/5.2/loadall.so'
	no file '/var/lib/prosody/.luarocks/lib/lua/5.2/basexx.so'
stack traceback:
	[C]: in function '_real_require'
	/usr/lib/prosody/util/startup.lua:199: in function 'require'
	/usr/share/jitsi-meet/prosody-plugins/token/util.lib.lua:4: in main chunk
	(...tail calls...)
	...re/jitsi-meet/prosody-plugins/mod_token_verification.lua:24: in main chunk
	[C]: in function 'xpcall'
	/usr/lib/prosody/core/modulemanager.lua:183: in function 'do_load_module'
	/usr/lib/prosody/core/modulemanager.lua:261: in function 'load'
	/usr/lib/prosody/core/modulemanager.lua:83: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/core/hostmanager.lua:108: in function 'activate'
	/usr/lib/prosody/core/hostmanager.lua:58: in function '?'
	/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
	(...tail calls...)
	/usr/lib/prosody/util/startup.lua:391: in function 'prepare_to_start'
	/usr/lib/prosody/util/startup.lua:613: in function 'f'
	/usr/lib/prosody/util/async.lua:139: in function 'func'
	/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

in jicofo logs get this when i initialized prosody service

Jicofo 2020-08-12 19:22:26.825 SEVERE: [366] org.jivesoftware.whack.ExternalComponentManager.error() 
java.net.SocketException: Broken pipe (Write failed)
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
	at java.io.BufferedWriter.flush(BufferedWriter.java:254)
	at org.dom4j.io.XMLWriter.flush(XMLWriter.java:272)
	at org.jivesoftware.whack.ExternalComponent.send(ExternalComponent.java:371)
	at org.jivesoftware.whack.ExternalComponentManager.sendPacket(ExternalComponentManager.java:269)
	at org.xmpp.component.AbstractComponent.send(AbstractComponent.java:925)
	at org.jitsi.xmpp.component.ComponentBase.access$400(ComponentBase.java:36)
	at org.jitsi.xmpp.component.ComponentBase$PingTask.run(ComponentBase.java:577)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)
Jicofo 2020-08-12 19:22:27.530 INFO: [28] org.jitsi.jicofo.xmpp.BaseBrewery.log() Added brewery instance: jvbbrewery@internal.auth.jitsi.server.name/9b06a786-8083-4ed4-b5c7-62b318887144
Jicofo 2020-08-12 19:22:27.530 INFO: [28] org.jitsi.jicofo.bridge.BridgeSelector.log() Added new videobridge: Bridge[jid=jvbbrewery@internal.auth.jitsi.server.name/9b06a786-8083-4ed4-b5c7-62b318887144, relayId=null, region=null, stress=0.00]
Jicofo 2020-08-12 19:22:27.531 INFO: [28] org.jitsi.jicofo.bridge.JvbDoctor.log() Scheduled health-check task for: jvbbrewery@internal.auth.jitsi.server.name/9b06a786-8083-4ed4-b5c7-62b318887144
Jicofo 2020-08-12 19:22:31.830 SEVERE: [403] org.jitsi.xmpp.component.ComponentBase.log() Ping timeout for ID: ePpAT-2526

I tried to resolve this problem reinstalling with luarocks all dependencies that I need like luacrypto, lua-cjson, lbase64 and luajwtjitsi to resolve this problem but it persist. :expressionless:

OS version and lua version?

Hello @damencho, OS Ubuntu 18.04.3 (LTS) x64 and lua version 5.2.4

So I suspect you also have and lua 5.1 and when you install dependencies like basexx they are installed for lua 5.1 and not for 5.2.
The easiest way I found is: https://stackoverflow.com/questions/20321560/how-do-install-libraries-for-both-lua5-2-and-5-1-using-luarocks
Download: http://luarocks.org/en/Download

./configure --lua-version=5.2 --versioned-rocks-dir
make build
sudo make install

And use /usr/local/bin/luarocks-5.2 to install dependencies.
/usr/local/bin/luarocks-5.2 install luajwtjitsi
/usr/local/bin/luarocks-5.2 install basexx
Restart prosody and try again.

Maybe you should try this https://community.jitsi.org/t/heres-how-you-should-install-jitsi-meet-tokens-on-debian-10

Hello, I installed lua-5.3.5 and then luarocks-0.5.2 from http://luarocks.org/
I runned configure, a make build and a make install, but at the moment of install dependencies i get this error with luajwtjitsi:

Installing https://luarocks.org/luajwtjitsi-1.3-7.rockspec
Cloning into 'luajwt'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 0), reused 1 (delta 0), pack-reused 0
Receiving objects: 100% (7/7), done.
Note: checking out 'e7a6ca8cbe5941638db34e280eff7e75c07c4ec9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

Missing dependencies for luajwtjitsi 1.3-7:
   luacrypto >= 0.3.2-1 (not installed)
   lua-cjson >= 2.1.0 (not installed)
   lbase64 >= 20120807-3 (not installed)

luajwtjitsi 1.3-7 depends on lua >= 5.1 (5.2-1 provided by VM)
luajwtjitsi 1.3-7 depends on luacrypto >= 0.3.2-1 (not installed)
Installing https://luarocks.org/luacrypto-0.3.2-2.src.rock

luacrypto 0.3.2-2 depends on lua >= 5.1 (5.2-1 provided by VM)
gcc -O2 -fPIC -I/usr/local/include -c src/lcrypto.c -o src/lcrypto.o -I/usr/include
src/lcrypto.c: In function ‘digest_pnew’:
src/lcrypto.c:81:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX {aka struct evp_md_ctx_st}’
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘digest_reset’:
src/lcrypto.c:120:10: warning: implicit declaration of function ‘EVP_MD_CTX_cleanup’; did you mean ‘EVP_MD_CTX_create’? [-Wimplicit-function-declaration]
     if (!EVP_MD_CTX_cleanup(c))
          ^~~~~~~~~~~~~~~~~~
          EVP_MD_CTX_create
src/lcrypto.c: In function ‘encrypt_pnew’:
src/lcrypto.c:331:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
     EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
                                                                     ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘encrypt_fencrypt’:
src/lcrypto.c:425:20: error: storage size of ‘c’ isn’t known
     EVP_CIPHER_CTX c;
                    ^
src/lcrypto.c: In function ‘decrypt_pnew’:
src/lcrypto.c:470:69: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
     EVP_CIPHER_CTX *c = (EVP_CIPHER_CTX *)lua_newuserdata(L, sizeof(EVP_CIPHER_CTX));
                                                                     ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘decrypt_fdecrypt’:
src/lcrypto.c:561:20: error: storage size of ‘c’ isn’t known
     EVP_CIPHER_CTX c;
                    ^
src/lcrypto.c: In function ‘hmac_pnew’:
src/lcrypto.c:604:57: error: invalid application of ‘sizeof’ to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
     HMAC_CTX *c = (HMAC_CTX *)lua_newuserdata(L, sizeof(HMAC_CTX));
                                                         ^~~~~~~~
src/lcrypto.c: In function ‘hmac_fnew’:
src/lcrypto.c:621:5: warning: implicit declaration of function ‘HMAC_CTX_init’; did you mean ‘HMAC_CTX_new’? [-Wimplicit-function-declaration]
     HMAC_CTX_init(c);
     ^~~~~~~~~~~~~
     HMAC_CTX_new
src/lcrypto.c: In function ‘hmac_clone’:
src/lcrypto.c:631:5: error: dereferencing pointer to incomplete type ‘HMAC_CTX {aka struct hmac_ctx_st}’
     *d = *c;
     ^~
src/lcrypto.c: In function ‘hmac_gc’:
src/lcrypto.c:697:5: warning: implicit declaration of function ‘HMAC_CTX_cleanup’; did you mean ‘HMAC_CTX_get_md’? [-Wimplicit-function-declaration]
     HMAC_CTX_cleanup(c);
     ^~~~~~~~~~~~~~~~
     HMAC_CTX_get_md
src/lcrypto.c: In function ‘hmac_fdigest’:
src/lcrypto.c:711:14: error: storage size of ‘c’ isn’t known
     HMAC_CTX c;
              ^
src/lcrypto.c: In function ‘sign_pnew’:
src/lcrypto.c:747:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX {aka struct evp_md_ctx_st}’
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘sign_fsign’:
src/lcrypto.c:828:20: error: storage size of ‘c’ isn’t known
         EVP_MD_CTX c;
                    ^
src/lcrypto.c: In function ‘verify_pnew’:
src/lcrypto.c:857:61: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_MD_CTX {aka struct evp_md_ctx_st}’
     EVP_MD_CTX *c = (EVP_MD_CTX *)lua_newuserdata(L, sizeof(EVP_MD_CTX));
                                                             ^~~~~~~~~~
src/lcrypto.c: In function ‘verify_fverify’:
src/lcrypto.c:940:20: error: storage size of ‘c’ isn’t known
         EVP_MD_CTX c;
                    ^
src/lcrypto.c: In function ‘rand_pseudo_bytes’:
src/lcrypto.c:992:5: warning: ‘RAND_pseudo_bytes’ is deprecated [-Wdeprecated-declarations]
     return rand_do_bytes(L, RAND_pseudo_bytes);
     ^~~~~~
In file included from /usr/include/openssl/e_os2.h:13:0,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/rand.h:44:1: note: declared here
 DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
 ^
src/lcrypto.c: In function ‘pkey_generate’:
src/lcrypto.c:1064:9: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
         RSA *rsa = RSA_generate_key(key_len, RSA_F4, NULL, NULL);
         ^~~
In file included from /usr/include/openssl/e_os2.h:13:0,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/rsa.h:234:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^
src/lcrypto.c:1074:9: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
         DSA *dsa = DSA_generate_parameters(key_len, NULL, 0, NULL, NULL, NULL, NULL);
         ^~~
In file included from /usr/include/openssl/e_os2.h:13:0,
                 from /usr/include/openssl/err.h:13,
                 from src/lcrypto.c:7:
/usr/include/openssl/dsa.h:117:1: note: declared here
 DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
 ^
src/lcrypto.c: In function ‘pkey_to_pem’:
src/lcrypto.c:1164:27: error: dereferencing pointer to incomplete type ‘struct evp_pkey_st’
     if (private && pkey_st->type == EVP_PKEY_DSA)
                           ^~
src/lcrypto.c: In function ‘pkey_tostring’:
src/lcrypto.c:1277:60: error: dereferencing pointer to incomplete type ‘EVP_PKEY {aka struct evp_pkey_st}’
     sprintf(buf, "%s %s %d %p", LUACRYPTO_PKEYNAME, (*pkey)->type == EVP_PKEY_DSA ? "DSA" : "RSA", EVP_PKEY_bits(*pkey), pkey);
                                                            ^~
src/lcrypto.c: In function ‘seal_pnew’:
src/lcrypto.c:1299:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
     c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
                                              ^~~~~~~~~~~~~~
In file included from src/lcrypto.c:8:0:
src/lcrypto.c: In function ‘seal_tostring’:
src/lcrypto.c:1320:81: error: dereferencing pointer to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
     sprintf(s, "%s %p %s", LUACRYPTO_SEALNAME, (void *)c, EVP_CIPHER_name(c->ctx->cipher));
                                                                                 ^
src/lcrypto.c: In function ‘seal_fseal’:
src/lcrypto.c:1400:20: error: storage size of ‘ctx’ isn’t known
     EVP_CIPHER_CTX ctx;
                    ^~~
src/lcrypto.c: In function ‘open_pnew’:
src/lcrypto.c:1483:46: error: invalid application of ‘sizeof’ to incomplete type ‘EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}’
     c->ctx = (EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX));
                                              ^~~~~~~~~~~~~~
src/lcrypto.c: In function ‘open_fopen’:
src/lcrypto.c:1602:20: error: storage size of ‘ctx’ isn’t known
     EVP_CIPHER_CTX ctx;
                    ^~~

Error: Failed installing dependency: https://luarocks.org/luacrypto-0.3.2-2.src.rock - Build error: Failed compiling object src/lcrypto.o

and for basexx:

Installing https://luarocks.org/basexx-0.4.1-1.rockspec

basexx 0.4.1-1 depends on lua >= 5.1 (5.2-1 provided by VM)
basexx 0.4.1-1 is now installed in /usr/local (license: MIT)

lua installed now is 5.3.5

I saw that the version into /usr/local/bin/luarocks now is 5.2, is it good?