[jitsi-dev] bug or configuration issue is_admin(user_jid) in mod_token_verification.lua code


#1

Hi list,
When I want activate token auth mode, I have an issue with
mod_token_verification.lua.

"""if is_admin(user_jid)""" does not work, it can't detect "focus" is admin.

*In prosody configuration we can see:*

"""

Component "conference.meet.winlux.fr" "muc"
    modules_enabled = { "token_verification" }
    *admins = { "focus@auth.meet.winlux.fr <focus@auth.meet.winlux.fr>" }*
    -- restrict_room_creation = "local"
    -- restrict_room_creation = true
    ssl = {
        certificate = "/var/lib/prosody/conference.meet.winlux.fr.crt";
    key = "/var/lib/prosody/conference.meet.winlux.fr.key";
    }
"""

I found a workarround to test,
I changed mod_token_verification.lua and it's work with this:

"""
log("debug", "TEST MIKA : %s", user_jid)
        --if is_admin(user_jid) then
        if string.match(user_jid, 'focus') then
                log("debug", "Token not required from admin user: %s",
user_jid);
                return nil;
        end
"""

it works now, but it's not the best way :frowning:

Do you have an idea please ?

thanks in advance


#2

Hi,

Just a guess, did you try adding that user as admin in general section
not only in component one?

Regards
damencho

···

On Thu, Apr 20, 2017 at 2:06 AM, Mickael Hubert <mickael@winlux.fr> wrote:

Hi list,
When I want activate token auth mode, I have an issue with
mod_token_verification.lua.

"""if is_admin(user_jid)""" does not work, it can't detect "focus" is admin.

In prosody configuration we can see:

"""

Component "conference.meet.winlux.fr" "muc"
    modules_enabled = { "token_verification" }
    admins = { "focus@auth.meet.winlux.fr" }
    -- restrict_room_creation = "local"
    -- restrict_room_creation = true
    ssl = {
        certificate = "/var/lib/prosody/conference.meet.winlux.fr.crt";
    key = "/var/lib/prosody/conference.meet.winlux.fr.key";
    }
"""

I found a workarround to test,
I changed mod_token_verification.lua and it's work with this:

"""
log("debug", "TEST MIKA : %s", user_jid)
        --if is_admin(user_jid) then
        if string.match(user_jid, 'focus') then
                log("debug", "Token not required from admin user: %s",
user_jid);
                return nil;
        end
"""

it works now, but it's not the best way :frowning:

Do you have an idea please ?

thanks in advance

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


#3

Hi,
thanks a lot for your answer.
it works now !

Next issue now :wink:

···

2017-04-20 18:13 GMT+02:00 Damian Minkov <damencho@jitsi.org>:

Hi,

Just a guess, did you try adding that user as admin in general section
not only in component one?

Regards
damencho

On Thu, Apr 20, 2017 at 2:06 AM, Mickael Hubert <mickael@winlux.fr> wrote:
> Hi list,
> When I want activate token auth mode, I have an issue with
> mod_token_verification.lua.
>
> """if is_admin(user_jid)""" does not work, it can't detect "focus" is
admin.
>
> In prosody configuration we can see:
>
> """
>
> Component "conference.meet.winlux.fr" "muc"
> modules_enabled = { "token_verification" }
> admins = { "focus@auth.meet.winlux.fr" }
> -- restrict_room_creation = "local"
> -- restrict_room_creation = true
> ssl = {
> certificate = "/var/lib/prosody/conference.meet.winlux.fr.crt";
> key = "/var/lib/prosody/conference.meet.winlux.fr.key";
> }
> """
>
> I found a workarround to test,
> I changed mod_token_verification.lua and it's work with this:
>
> """
> log("debug", "TEST MIKA : %s", user_jid)
> --if is_admin(user_jid) then
> if string.match(user_jid, 'focus') then
> log("debug", "Token not required from admin user: %s",
> user_jid);
> return nil;
> end
> """
>
> it works now, but it's not the best way :frowning:
>
> Do you have an idea please ?
>
> thanks in advance
>
> _______________________________________________
> dev mailing list
> dev@jitsi.org
> Unsubscribe instructions and other list options:
> http://lists.jitsi.org/mailman/listinfo/dev

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