Jitsi Meet, xmpp_username_override, xmpp_password_override


#1

Hello, I deployed my own Jitsi Server on Debian 8, secured wih Secure Domain, and builded my own Jitsi Meet Android app.

I would like that my app bypass entering auth credentials.
So I modified in this way the function openConnection (connection.js), removing the following lines (with comments)
/**************************************************************************
const usernameOverride
= jitsiLocalStorage.getItem(‘xmpp_username_override’);
const passwordOverride
= jitsiLocalStorage.getItem(‘xmpp_password_override’);
***************************************************************************/
and trying the lines
const usernameOverride = ‘goahead’;
const passwordOverride = ‘daehaog’;
or
const usernameOverride = ‘goahead@mydomain.com’;
const passwordOverride = ‘daehaog’;

Both tries did’nt have success, the app still ask for user/password.
User goahead@mydomain.com was created with prosodyctl and tested entering his credentials manually.

What am I doing wrong?


#2

This code is not used on mobile, you need to find the relevant place probably in react/features/base/connection.


#3

Hi, I modified function connect in react/features/base/connection/actions.native.js in this way:

export function connect(id: ?string, password: ?string) {

const config = state[‘features/base/config’];
const usernameOverride = toJid(‘goahead’, config.hosts);
const passwordOverride = ‘daehaog’;

 console.log ('XMPP USERNAME OVERRIDE: ', usernameOverride);
 console.log ('XMPP PASSWORD OVERRIDE: ', passwordOverride);

 return connection.connect({
        //id,
        //password
       usernameOverride,
       passwordOverride
 });

The app log on console the correct Jid, goahead@domain.com, but I get the same error:

09-10 21:21:34.963 26700 26755 W ReactNativeJS: ‘[modules\xmpp\moderator.js]’, ': ', ‘Unauthorized to start the conference’, ‘not authorized user domain’


#4

Seems like jicofo is returning an unauthorized error.
Do you have XMPP:domain.com in the jicofo config, had you restarted jicofo after adding that?


#5

To be sure I have just rebooted the server and cleared data and cache of the app.
Same error:
09-10 22:12:33.341 28916 28954 W ReactNativeJS: ‘[modules\xmpp\moderator.js]’, ': ', ‘Unauthorized to start the conference’, ‘not authorized user domain’


#6

I added the row:
XMPP:domain.com

but there already were the rows:
sets the XMPP domain (default: none)
JICOFO_HOSTNAME=domain.com


#7

Sorry for the confusion, so the doc https://github.com/jitsi/jicofo#secure-domain
states you need to add to your config (/etc/jitsi/jicofo/sip-communicator.properties)

org.jitsi.jicofo.auth.URL=XMPP:domain

This is what I was asking for.


#8

I have the row you suggest.
In fact Secure Domain is working fine.


#9

Jicofo for some reason says you are not authorized to request room creation. Make sure that toJid function returns the correct domain.


#10

It does.
console.log ('XMPP USERNAME OVERRIDE: ', usernameOverride) echoes the correct jid, goahead@domain.com.
I tested his credential by web and by app


#11

I did’nt find any occurence of the string ‘goahead’ in jicofo.log, prosody log.
It seems that is never used to authenticate … after deleting the log files, restarted the sytem and tried to join the room with the app


#12

Looking at the log file of the app I noticed that trying to authenticate with the xmpp user override, the Jabber Id refers to guest.mydomain.com:

09-11 07:06:34.948 28152 28191 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘(TIME) Strophe connected:\t’, 1536642394947
09-11 07:06:34.949 28152 28191 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘My Jabber ID: 1c9dd4d0-7c0f-47f5-81be-010a39328b4c@guest.mydomain.com/e7fdbc34-c367-4b6d-8b38-1cf06e269724’
09-11 07:06:34.952 28152 28191 D ReactNativeJS: ‘[modules\xmpp\strophe.util.js]’, ': ', ‘Strophe’, 0, ‘_throttledRequestHandler called with 0 requests’
09-11 07:06:34.983 28152 28191 I ReactNativeJS: ‘[modules\xmpp\ChatRoom.js]’, ': ', ‘Joined MUC as 12345@conference.mydomain.com/1c9dd4d0’

Later, entering the same credentials manually, the jabber id refers to gohead@mydomain.dom

09-11 07:07:03.840 28152 28191 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘(TIME) Strophe connected:\t’, 1536642423840
09-11 07:07:03.841 28152 28191 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘My Jabber ID: goahead@mydomain.com/30589fa2-3e8e-4fcf-8cdb-257a0cca0f74’
09-11 07:07:03.843 28152 28191 D ReactNativeJS: ‘[modules\xmpp\strophe.util.js]’, ': ', ‘Strophe’, 0, ‘_throttledRequestHandler called with 0 requests’
09-11 07:07:03.869 28152 28191 I ReactNativeJS: ‘[modules\xmpp\ChatRoom.js]’, ': ', ‘Joined MUC as 12345@conference.mydomain.com/goahead-f6a595’


#13

It seems that lib-jitsi-meet does’nt receive the credentials
I cloned and rebuilded lib-jitsi-meet, inserting some debug rows in xmpp.js

141 logger.info (‘ConnectionHandler CREDENTIALS:’, credentials);
281 logger.info (’_connect CREDENTIALS:’, jid, password);
303 logger.info (‘attach CREDENTIALS:’, options.jid, options.password);
322 logger.info (‘connect CREDENTIALS:’, jid, password);

Getting these rows of app log:

Line 53: 09-11 13:53:21.225 5246 5316 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘connect CREDENTIALS:’, undefined, undefined
Line 54: 09-11 13:53:21.228 5246 5316 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘_connect CREDENTIALS:’, ‘guest.mydomain.com’, undefined
Line 55: 09-11 13:53:21.233 5246 5316 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘ConnectionHandler CREDENTIALS:’, { jid: ‘guest.mydomain.com’, password: undefined }
Line 132: 09-11 13:53:22.584 5246 5316 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘ConnectionHandler CREDENTIALS:’, { jid: ‘guest.mydomain.com’, password: undefined }
Line 181: 09-11 13:53:25.997 5246 5316 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘ConnectionHandler CREDENTIALS:’, { jid: ‘guest.mydomain.com’, password: undefined }
Line 260: 09-11 13:53:26.461 5246 5316 I ReactNativeJS: ‘[modules\xmpp\xmpp.js]’, ': ', ‘ConnectionHandler CREDENTIALS:’, { jid: ‘guest.mydomain.com’, password: undefined }

Is my code wrong?


#14

Coding in a different way, it’s working:

export function connect(id: ?string, password: ?string) {
const usernameOverride = ‘goahead’;
const passwordOverride = ‘daehaog’;

id = usernameOverride; // eslint-disable-line no-param-reassign
password = passwordOverride; // eslint-disable-line no-param-reassign



const config = state[‘features/base/config’];
id = toJid(id, config.hosts); // eslint-disable-line no-param-reassign

   console.log ('XMPP USERNAME OVERRIDE: ', id);
   console.log ('XMPP PASSWORD OVERRIDE: ', password);

    return connection.connect({
        id,
        password
    });