Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

JWT token is now passed as BOSH URL parameter.

paweldomasca8a147ea652
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 9b8ae0ce3a..1685f5dfbd 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -325,8 +325,16 @@ function registerListeners() {
"dialog.connectError", pres);
});
APP.xmpp.addListener(XMPPEvents.ROOM_CONNECT_ERROR, function (pres) {
- UI.messageHandler.openReportDialog(null,
- "dialog.connectError", pres);
+ if (config.token &&
+ $(pres).find(
+ '>error[type="cancel"]' +
+ '>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]'
+ ).length) {
+ messageHandler.showError("dialog.error", "dialog.tokenAuthFailed");
+ } else {
+ UI.messageHandler.openReportDialog(null,
+ "dialog.connectError", pres);
+ }
});
APP.xmpp.addListener(XMPPEvents.READY_TO_JOIN, function () {
diff --git a/modules/xmpp/strophe.emuc.js b/modules/xmpp/strophe.emuc.js
index ef6be3585a..2b83c049bf 100644
--- a/modules/xmpp/strophe.emuc.js
+++ b/modules/xmpp/strophe.emuc.js
@@ -562,10 +562,6 @@ module.exports = function(XMPP, eventEmitter) {
delete this.presMap["startMuted"];
}
- if (config.token) {
- pres.c('token', { xmlns: 'http://jitsi.org/jitmeet/auth-token'}).t(config.token).up();
- }
-
pres.up();
this.connection.send(pres);
},
diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js
index 0e90713d2a..0edc1c41b0 100644
--- a/modules/xmpp/xmpp.js
+++ b/modules/xmpp/xmpp.js
@@ -308,21 +308,16 @@ var XMPP = {
configDomain = config.hosts.domain;
}
var jid = configDomain || window.location.hostname;
- var password = null;
- if (config.token) {
- password = config.token;
- if (config.id) {
- jid = config.id + "@" + jid;
- } else {
- jid = generateUserName() + "@" + jid;
- }
- }
- connect(jid, password);
+ connect(jid);
},
createConnection: function () {
var bosh = config.bosh || '/http-bind';
// adds the room name used to the bosh connection
- return new Strophe.Connection(bosh + '?room=' + APP.UI.getRoomNode());
+ bosh += '?room=' + APP.UI.getRoomNode();
+ if (config.token) {
+ bosh += "&token=" + config.token;
+ }
+ return new Strophe.Connection(bosh);
},
getStatusString: function (status) {
return Strophe.getStatusString(status);