Преглед изворни кода

Update tokens.md

release-8443
Paweł Domas пре 9 година
родитељ
комит
435cdc91ec
1 измењених фајлова са 47 додато и 25 уклоњено
  1. 47
    25
      doc/tokens.md

+ 47
- 25
doc/tokens.md Прегледај датотеку

@@ -7,6 +7,8 @@ generate the JWT token as described in the RFC and pass it to your client app. O
7 7
 
8 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 12
 [RFC7519]: https://tools.ietf.org/html/rfc7519
11 13
 [http://jwt.io/#libraries-io]: http://jwt.io/#libraries-io
12 14
 
@@ -21,10 +23,9 @@ Secret is used to compute HMAC hash value and verify the token.
21 23
 
22 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 30
 ### Lib-jitsi-meet options
30 31
 
@@ -51,50 +52,71 @@ At current level of integration every user that joins the conference has to prov
51 52
 creates the room. It should be possible to change that by using second anonymous domain, but that hasn't been tested
52 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 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 97
 ### Manual plugin configuration
67 98
 
68 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 103
 ```lua
73 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 109
 ```lua
79 110
 VirtualHost "jitmeet.example.com"
80 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 119
 ```lua
91 120
 Component "conference.jitmeet.example.com" "muc"
92 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…
Откажи
Сачувај