[jitsi-dev] JWT auth room name check not working


#1

Hello everybody! First time here, I hope this is the right way of getting
help.

I installed jitsi using the quick install guide on a Debian Jessie machine
and then installed and configured the JWT authentication following the
instructions here
<https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md>.

When I try to create a new room with a valid token, I get an error in
prosody in the mod_token_verification.lua file saying the lower function
can't be called on a nil value in line 64. Indeed the session.auth_token
and session.jitsi_meet_room properties are both nil.

I overcame the issue returning always nil in the verify_user function, so
the room checking has no effect, now everythigns works like a charm.

But I'd like to have room checking! What could be the cause of that
variables not being present?

Here is an extract from my prosody.log file:
May 14 19:04:28 c2s274af10 debug Received[c2s]: <presence
id='wvWGi-1575' to='test@conference.call.mydomain.com/focus'>
May 14 19:04:28 conference.call.my.com:token_verification debug pre
create: table: 0x274af10 <presence id='wvWGi-1575' to='test@conference.call.
$
May 14 19:04:28 conference.call.mydomain.com:token_verification debug
  Session token: nil, session room: nil
May 14 19:04:28 conference.call.mydomain.com:token_verification debug
  Will verify token for user:
focus@auth.call.mydomain.com/focus4655997556188, r$
May 14 19:04:28 c2s274af10 error Traceback[c2s]:
...itsi-meet/prosody-plugins/mod_token_verification.lua:64: bad argument #1
to 'lower' (string expected,$
stack traceback:
        [C]: in function 'lower'
        ...itsi-meet/prosody-plugins/mod_token_verification.lua:64: in
function <...itsi-meet/prosody-plugins/mod_token_verification.lua:34>
        (tail call): ?
        /usr/lib/prosody/util/events.lua:78: in function
</usr/lib/prosody/util/events.lua:74>
        (tail call): ?
        (tail call): ?
        /usr/lib/prosody/modules/muc/muc.lib.lua:392: in function
</usr/lib/prosody/modules/muc/muc.lib.lua:388>

Also I'd like to report a minor error in the JWT guide, in the section Jitsi
meet Options
<https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md#jitsi-meet-options>
the
example url should not include quotes in the parameter.

Thanks in advance! BTW awesome piece of software :smiley:

···

--
Rodrigo Pérez Fulloni


#2

Hi
can you add focus user as admin , in genral section of prosody. and retry.

if you used the latest build of jiti meet there is a issue about token. I
must retry today.

bye

···

Le 14 mai 2017 22:27, "Rodrigo Pérez Fulloni" <rodripf@gmail.com> a écrit :

Hello everybody! First time here, I hope this is the right way of getting
help.

I installed jitsi using the quick install guide on a Debian Jessie machine
and then installed and configured the JWT authentication following the
instructions here
<https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md>.

When I try to create a new room with a valid token, I get an error in
prosody in the mod_token_verification.lua file saying the lower function
can't be called on a nil value in line 64. Indeed the session.auth_token
and session.jitsi_meet_room properties are both nil.

I overcame the issue returning always nil in the verify_user function, so
the room checking has no effect, now everythigns works like a charm.

But I'd like to have room checking! What could be the cause of that
variables not being present?

Here is an extract from my prosody.log file:
May 14 19:04:28 c2s274af10 debug Received[c2s]: <presence
id='wvWGi-1575' to='test@conference.call.mydomain.com/focus'>
May 14 19:04:28 conference.call.my.com:token_verification debug
pre create: table: 0x274af10 <presence id='wvWGi-1575'
to='test@conference.call.$
May 14 19:04:28 conference.call.mydomain.com:token_verification
debug Session token: nil, session room: nil
May 14 19:04:28 conference.call.mydomain.com:token_verification
debug Will verify token for user: focus@auth.call.mydomain.com/
focus4655997556188, r$
May 14 19:04:28 c2s274af10 error Traceback[c2s]:
...itsi-meet/prosody-plugins/mod_token_verification.lua:64: bad argument
#1 to 'lower' (string expected,$
stack traceback:
        [C]: in function 'lower'
        ...itsi-meet/prosody-plugins/mod_token_verification.lua:64: in
function <...itsi-meet/prosody-plugins/mod_token_verification.lua:34>
        (tail call): ?
        /usr/lib/prosody/util/events.lua:78: in function
</usr/lib/prosody/util/events.lua:74>
        (tail call): ?
        (tail call): ?
        /usr/lib/prosody/modules/muc/muc.lib.lua:392: in function
</usr/lib/prosody/modules/muc/muc.lib.lua:388>

Also I'd like to report a minor error in the JWT guide, in the section Jitsi
meet Options
<https://github.com/jitsi/lib-jitsi-meet/blob/master/doc/tokens.md#jitsi-meet-options> the
example url should not include quotes in the parameter.

Thanks in advance! BTW awesome piece of software :smiley:

--
Rodrigo Pérez Fulloni

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#3

Hi,

I suppose you are using the stable branch, as the nightlies have some
modification in those modules and we are still clearing some stuff
there.
When using the stable branch you can try using the following config:
disable_room_name_constraints = true.

But session token and session room should be not null when providing a
token... The documentation used to say that providing a token is done
by adding "#config.token=token_string" (check out the change:
https://github.com/jitsi/lib-jitsi-meet/commit/d9eabf74ba7edcee2bff48e052246f0dc4bda4e0).
Just wondering is this the problem you have or the prosody version you
are using.

You should be using prosody-trunk and if it is an earlier version you
need this patch
https://github.com/jitsi/jitsi-meet/blob/master/resources/prosody-plugins/mod_bosh.lua.patch.
But latest versions of prosody contain that patch, I don't have the
exact numbers when this was included, but it is easy to check whether
you have this in the prosody lua code.

Regards
damencho

Regards
damencho

···

On Sun, May 14, 2017 at 3:26 PM, Rodrigo Pérez Fulloni <rodripf@gmail.com> wrote:

Hello everybody! First time here, I hope this is the right way of getting
help.

I installed jitsi using the quick install guide on a Debian Jessie machine
and then installed and configured the JWT authentication following the
instructions here.

When I try to create a new room with a valid token, I get an error in
prosody in the mod_token_verification.lua file saying the lower function
can't be called on a nil value in line 64. Indeed the session.auth_token and
session.jitsi_meet_room properties are both nil.

I overcame the issue returning always nil in the verify_user function, so
the room checking has no effect, now everythigns works like a charm.

But I'd like to have room checking! What could be the cause of that
variables not being present?

Here is an extract from my prosody.log file:
May 14 19:04:28 c2s274af10 debug Received[c2s]: <presence
id='wvWGi-1575' to='test@conference.call.mydomain.com/focus'>
May 14 19:04:28 conference.call.my.com:token_verification debug pre
create: table: 0x274af10 <presence id='wvWGi-1575'
to='test@conference.call.$
May 14 19:04:28 conference.call.mydomain.com:token_verification debug
Session token: nil, session room: nil
May 14 19:04:28 conference.call.mydomain.com:token_verification debug
Will verify token for user: focus@auth.call.mydomain.com/focus4655997556188,
r$
May 14 19:04:28 c2s274af10 error Traceback[c2s]:
...itsi-meet/prosody-plugins/mod_token_verification.lua:64: bad argument #1
to 'lower' (string expected,$
stack traceback:
        [C]: in function 'lower'
        ...itsi-meet/prosody-plugins/mod_token_verification.lua:64: in
function <...itsi-meet/prosody-plugins/mod_token_verification.lua:34>
        (tail call): ?
        /usr/lib/prosody/util/events.lua:78: in function
</usr/lib/prosody/util/events.lua:74>
        (tail call): ?
        (tail call): ?
        /usr/lib/prosody/modules/muc/muc.lib.lua:392: in function
</usr/lib/prosody/modules/muc/muc.lib.lua:388>

Also I'd like to report a minor error in the JWT guide, in the section Jitsi
meet Options the example url should not include quotes in the parameter.

Thanks in advance! BTW awesome piece of software :smiley:

--
Rodrigo Pérez Fulloni

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#4

This did the job! The focus user was present in the jitsi prosody config
file, but not in the general prosody config file.
I am using the stable version of jitsi and prosody-trunk.

Thank you both of you for your help!

···

On Mon, May 15, 2017 at 1:44 AM, Mickael Hubert <mickael@winlux.fr> wrote:

Hi
can you add focus user as admin, in general section of prosody. and retry.

--
Rodrigo Pérez Fulloni