Browse Source

Update tokens.md

release-8443
Paweł Domas 9 years ago
parent
commit
435cdc91ec
1 changed files with 47 additions and 25 deletions
  1. 47
    25
      doc/tokens.md

+ 47
- 25
doc/tokens.md View File

7
 
7
 
8
 During configuration you will need to provide the *application ID* that identifies the client and a *secret* shared by both server and JWT token generator. Like described in the RFC, secret is used to compute HMAC hash value which allows to authenticate generated token. There are many existing libraries which can be used to implement token generator. More info can be found here: [http://jwt.io/#libraries-io]
8
 During configuration you will need to provide the *application ID* that identifies the client and a *secret* shared by both server and JWT token generator. Like described in the RFC, secret is used to compute HMAC hash value which allows to authenticate generated token. There are many existing libraries which can be used to implement token generator. More info can be found here: [http://jwt.io/#libraries-io]
9
 
9
 
10
+JWT token authentication currently works only with BOSH connections.
11
+
10
 [RFC7519]: https://tools.ietf.org/html/rfc7519
12
 [RFC7519]: https://tools.ietf.org/html/rfc7519
11
 [http://jwt.io/#libraries-io]: http://jwt.io/#libraries-io
13
 [http://jwt.io/#libraries-io]: http://jwt.io/#libraries-io
12
 
14
 
21
 
23
 
22
 ### Token verification
24
 ### Token verification
23
 
25
 
24
-JWT token is currently checked in 3 places:
25
-- when user connects to Prosody. SASL PLAIN authentication is being used for token authentication purpose. Username is supplied by the application and in case of jitsi-meet it is randomly generated string(can be also overridden with *config.id* property). JWT token is apssed as user's password.
26
-- by Jicofo in *conference IQ* which is used to invite the focus and create the room. JWT token is sent in 'session-id' attribute.
27
-- when MUC room is being created. This prevents from abusing stolen token by unathorized users. Unless the user is an admin it must include it as part of the presence stanza that creates the room. *FIXME this is redundant as we can config Prosody to allow only admins to create the rooms and let Jicofo verify the token*.
26
+JWT token is currently checked in 2 places:
27
+- when user connects to Prosody through BOSH. Token value is passed as 'token' query paramater of BOSH URL. User uses XMPP anonymous authentication method.
28
+- when MUC room is being created/joined Prosody compares 'room' claim with the actual name of the room. This prevents from abusing stolen token by unathorized users to allocate new conference rooms in the system. Admin users are not required to provide valid token which is used by Jicofo for example.
28
 
29
 
29
 ### Lib-jitsi-meet options
30
 ### Lib-jitsi-meet options
30
 
31
 
51
 creates the room. It should be possible to change that by using second anonymous domain, but that hasn't been tested
52
 creates the room. It should be possible to change that by using second anonymous domain, but that hasn't been tested
52
 yet.
53
 yet.
53
 
54
 
54
-### Installing token plugin
55
 
55
 
56
-FIXME: JWT token install using Debian packages is not implemented yet
57
 
56
 
58
-~~Token authentication can be integrated automatically using Debian package install. Once you have jitsi-meet installed
59
-just install 'jitsi-meet-tokens' on top of it. In order to have it configured automatically at least version 721 of
60
-jitsi-meet is required which comes with special Prosody config template.~~
57
+### Installing token plugin
58
+
59
+Token authentication can be integrated automatically using Debian package install. Once you have jitsi-meet installed
60
+just install 'jitsi-meet-tokens' on top of it. In order to have it configured automatically at least version 779 of
61
+jitsi-meet is required which comes with special Prosody config template.
61
 
62
 
62
 ```
63
 ```
63
 apt-get install jitsi-meet-token
64
 apt-get install jitsi-meet-token
64
 ```
65
 ```
65
 
66
 
67
+Proceed to "Patching Prosody" section to finish configuration.
68
+
69
+### Patching Prosody
70
+
71
+JWT token authentication requires prosody-trunk version at least 603. It also requires special patch that allows the plugin to retrieve the token from BOSH URL.
72
+
73
+You can download latest prosody-trunk packages from [here]. Then install it with the following command:
74
+
75
+```
76
+sudo dpkg -i prosody-trunk_1nightly603-1~trusty_amd64.deb
77
+```
78
+
79
+Next step is to patch Prosody. If you have *jitsi-meet-tokens* package installed just use the following command:
80
+```
81
+sudo patch -N /usr/lib/prosody/modules/mod_bosh.lua /usr/share/jitsi-meet/prosody-plugins/mod_bosh.lua.patch
82
+```
83
+
84
+Also make sure that */etc/prosody/prosody.cfg.lua* contains the line below at the end to include meet host config. That's because Prosody nightly may come with slightly different default config:
85
+
86
+```
87
+Include "conf.d/*.cfg.lua"
88
+```
89
+
90
+Also check if client to server encryption is not enforced. Otherwise token authentication won't work:
91
+```
92
+c2s_require_encryption=false
93
+```
94
+
95
+[here]: http://packages.prosody.im/debian/pool/main/p/prosody-trunk/
96
+
66
 ### Manual plugin configuration
97
 ### Manual plugin configuration
67
 
98
 
68
 Modify your Prosody config with these three steps:
99
 Modify your Prosody config with these three steps:
69
 
100
 
70
-1. Adjust *plugin_paths* to contain the path pointing to jitsi meet Prosody plugins location. That's where plugins are copied on *jitsi-meet-token* package install. This should be included in global config section(possibly at the beginning of your host config file).
101
+\1. Adjust *plugin_paths* to contain the path pointing to jitsi meet Prosody plugins location. That's where plugins are copied on *jitsi-meet-token* package install. This should be included in global config section(possibly at the beginning of your host config file).
71
 
102
 
72
 ```lua
103
 ```lua
73
 plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/" }
104
 plugin_paths = { "/usr/share/jitsi-meet/prosody-plugins/" }
74
 ```
105
 ```
75
 
106
 
76
-2. Under you domain config change authentication to "token" and provide application ID, secret and optionally token lifetime:
107
+\2. Under you domain config change authentication to "token" and provide application ID, secret and optionally token lifetime:
77
 
108
 
78
 ```lua
109
 ```lua
79
 VirtualHost "jitmeet.example.com"
110
 VirtualHost "jitmeet.example.com"
80
     authentication = "token";
111
     authentication = "token";
81
-    allow_unencrypted_plain_auth = true; -- required for token authentication to work
82
-    app_id = example_app_id;             -- application identifier
83
-    app_secret = example_app_secret;     -- application secret known only to your token
84
-    									 -- generator and the plugin
85
-    token_lifetime=86400000;             -- (optional) token lifetime in milliseconds
86
-``` 
112
+    app_id = "example_app_id";             -- application identifier
113
+    app_secret = "example_app_secret";     -- application secret known only to your token
114
+    									   -- generator and the plugin
115
+```
87
 
116
 
88
-3. Enable token verification plugin in your MUC component config section:
117
+\3. Enable token verification plugin in your MUC component config section:
89
 
118
 
90
 ```lua
119
 ```lua
91
 Component "conference.jitmeet.example.com" "muc"
120
 Component "conference.jitmeet.example.com" "muc"
92
     modules_enabled = { "token_verification" }
121
     modules_enabled = { "token_verification" }
93
 ```
122
 ```
94
-
95
-4. Configure JWT properties in jicofo config file located usually at /etc/jitsi/jicofo/sip-cumminicator.properties.
96
-
97
-```
98
-org.jitsi.jicofo.auth.jwt.APP_ID=example_app_id
99
-org.jitsi.jicofo.auth.jwt.SECRET=example_app_secret
100
-```

Loading…
Cancel
Save