Bad argument #1 to 'lower'

Hi

After I setup JWT I cant enter to the room from lobby

prosody logs:


c2s55a93a61fd40                                              error      Traceback[c2s]: /prosody-plugins/token/util.lib.lua:342: bad argument #1 to 'lower' (string expected, got nil)
        stack traceback:
        [C]: in function 'string.lower'
        /prosody-plugins/token/util.lib.lua:342: in method 'verify_room'
        /prosody-plugins/mod_token_verification.lua:62: in upvalue 'verify_user'
        /prosody-plugins/mod_token_verification.lua:86: in field '?'
        /usr/share/lua/5.4/prosody/util/events.lua:81: in function </usr/share/lua/5.4/prosody/util/events.lua:77>
        (...tail calls...)
        /usr/lib/prosody/modules/muc/muc.lib.lua:684: in function </usr/lib/prosody/modules/muc/muc.lib.lua:618>
        (...tail calls...)
        /usr/share/lua/5.4/prosody/util/events.lua:81: in function </usr/share/lua/5.4/prosody/util/events.lua:77>
        (...tail calls...)
        /usr/share/lua/5.4/prosody/core/stanza_router.lua:188: in upvalue 'core_post_stanza'
        /usr/share/lua/5.4/prosody/core/stanza_router.lua:128: in upvalue 'core_process_stanza'
        /usr/lib/prosody/modules/mod_c2s.lua:326: in upvalue 'func'
        /usr/share/lua/5.4/prosody/util/async.lua:144: in function </usr/share/lua/5.4/prosody/util/async.lua:142>
speakerstats.meet.jibri:speakerstats_component               warn       A module has been configured that triggers external events.
speakerstats.meet.jibri:speakerstats_component               warn       Implement this lib to trigger external events.
[root@dev_11-awa docker-jitsi-meet-stable-8138-1]#  Traceback[c2s]: /prosody-plugins/token/util.lib.lua:342: bad argument #1 to 'lower' (string expected, got nil)

docker containers:


82cb34e0f023   jitsi/jibri:stable-8138-1                                    "/init"                  30 minutes ago   Up 30 minutes                                                                                                                                                                                          docker-jitsi-meet-stable-8138-1_jibri_1
5e316f60a43f   jitsi/jvb:stable-8138-1                                      "/init"                  30 minutes ago   Up 30 minutes   127.0.0.1:8080->8080/tcp, 0.0.0.0:10000->10000/udp, :::10000->10000/udp                                                                                                                docker-jitsi-meet-stable-8138-1_jvb_1
563bcd2de823   jitsi/jicofo:stable-8138-1                                   "/init"                  30 minutes ago   Up 30 minutes                                                                                                                                                                                          docker-jitsi-meet-stable-8138-1_jicofo_1
294fbb1ef599   jitsi/web:stable-8138-1                                      "/init"                  30 minutes ago   Up 30 minutes   0.0.0.0:8000->80/tcp, :::8000->80/tcp, 0.0.0.0:8443->443/tcp, :::8443->443/tcp                                                                                                         docker-jitsi-meet-stable-8138-1_web_1
5ec741c93827   jitsi/prosody:stable-8138-1                                  "/init"                  30 minutes ago   Up 30 minutes   5222/tcp, 5280/tcp, 5347/tcp                                                                                                                                                           docker-jitsi-meet-stable-8138-1_prosody_1

docker env variables:

#
# Authentication configuration (see handbook for details)
#

# Enable authentication
ENABLE_AUTH=1

# Enable guest access
ENABLE_GUESTS=0

# Select authentication type: internal, jwt, ldap or matrix
AUTH_TYPE=jwt
ENABLE_AUTO_LOGIN=0

# 
# JWT authentication
#

# Application identifier
JWT_APP_ID=my_jitsi_app_id

# Application secret known only to your token
JWT_APP_SECRET=you_need_to_make_sure_to_generate_the_jwt_token_by_providing_the_payload_and_JWT_APP_SECRET_value_on_the_VERIFY_SIGNATURE_section

# (Optional) Set asap_accepted_issuers as a comma separated list
#JWT_ACCEPTED_ISSUERS=my_web_client,my_app_client

# (Optional) Set asap_accepted_audiences as a comma separated list
#JWT_ACCEPTED_AUDIENCES=myserver1,myserver2

JWT_ALLOW_EMPTY=0

JWT_AUTH_TYPE=token

JWT_TOKEN_AUTH_MODULE=token_verification

I found at git and here at forum that this issue was fixed in the past, right know I have the newset version of docker jitsi, I cant find a reason of this issue. When I turn off the jwt token (ENABLE_AUTH=0) I can enter the room

token example:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb250ZXh0Ijp7InVzZXIiOnsibmFtZSI6IlBhd2VsVGVzdCJ9fSwiYXVkIjoibXlfaml0c2lfYXBwX2lkIiwiaXNzIjoibXlfaml0c2lfYXBwX2lkIiwicm9vbSI6InJvb210ZXN0IiwiZXhwIjoxNjcyOTM5ODMxLCJuYmYiOjE2NzI2MTU4MDd9.Bp86H2LMcrsz6Kmyy5aBoXQklDkDaZ-tVPFdo6gFVso

Your token is missing sub field.

Thanks! This is it

What exactly is sub? Which docker env should represent this claim?

Internal XMPP domain
XMPP_DOMAIN=meet.jitsi

?

It’s not a docker env but the contents of the JWT token used.

Even if you disable subdomain verification, your tokens must still contain the ‘sub’ claim as documented here: lib-jitsi-meet/tokens.md at master · jitsi/lib-jitsi-meet · GitHub

1 Like