Browse Source

feat(iframe_api): Add jwt token parameter

j8
hristoterezov 8 years ago
parent
commit
aeb301c8d5
2 changed files with 16 additions and 1 deletions
  1. 8
    0
      doc/api.md
  2. 8
    1
      modules/API/external/external_api.js

+ 8
- 0
doc/api.md View File

40
 var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite);
40
 var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite);
41
 ```
41
 ```
42
 
42
 
43
+You can also pass jwt token to Jitsi Meet:
44
+
45
+ ```javascript
46
+ var jwt = "<jwt_token>";
47
+ var noSsl = false;
48
+ var api = new JitsiMeetExternalAPI(domain, room, width, height, htmlElement, configOverwrite, interfaceConfigOverwrite, noSsl, jwt);
49
+ ```
50
+
43
 ## Controlling the embedded Jitsi Meet Conference
51
 ## Controlling the embedded Jitsi Meet Conference
44
 
52
 
45
 You can control the embedded Jitsi Meet conference using the `JitsiMeetExternalAPI` object by using `executeCommand`:
53
 You can control the embedded Jitsi Meet conference using the `JitsiMeetExternalAPI` object by using `executeCommand`:

+ 8
- 1
modules/API/external/external_api.js View File

93
  * @param interfaceConfigOverwrite object containing configuration options
93
  * @param interfaceConfigOverwrite object containing configuration options
94
  * defined in interface_config.js to be overridden.
94
  * defined in interface_config.js to be overridden.
95
  * @param noSsl if the value is true https won't be used
95
  * @param noSsl if the value is true https won't be used
96
+ * @param {string} [jwt] the JWT token if needed by jitsi-meet for
97
+ * authentication.
96
  * @constructor
98
  * @constructor
97
  */
99
  */
98
 function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
100
 function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
99
-    configOverwrite, interfaceConfigOverwrite, noSsl) {
101
+    configOverwrite, interfaceConfigOverwrite, noSsl, jwt) {
100
     if (!width || width < MIN_WIDTH)
102
     if (!width || width < MIN_WIDTH)
101
         width = MIN_WIDTH;
103
         width = MIN_WIDTH;
102
     if (!height || height < MIN_HEIGHT)
104
     if (!height || height < MIN_HEIGHT)
121
     this.url = (noSsl) ? "http" : "https" +"://" + domain + "/";
123
     this.url = (noSsl) ? "http" : "https" +"://" + domain + "/";
122
     if(room_name)
124
     if(room_name)
123
         this.url += room_name;
125
         this.url += room_name;
126
+
127
+    if (jwt) {
128
+        this.url += '?jwt=' + jwt;
129
+    }
130
+
124
     this.url += "#jitsi_meet_external_api_id=" + id;
131
     this.url += "#jitsi_meet_external_api_id=" + id;
125
 
132
 
126
     var key;
133
     var key;

Loading…
Cancel
Save