forked from w3c/webrtc-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
section13
331 lines (331 loc) · 15.4 KB
/
section13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<section id="removed-features">
<h3>Removed features</h3>
<p>
This section documents features that were moved from [[WEBRTC]] to this extension
specification due to lack of support from implementers.
</p>
<section id="removed-rtcpeerconnection-features">
<h3>
{{RTCPeerConnection}} extensions
</h3>
<p>
The {{RTCPeerConnection}}
interface is defined in [[WEBRTC]]. This document extends that interface
by adding an additional static method.
</p>
<pre class="idl">partial interface RTCPeerConnection {
static sequence<RTCIceServer> getDefaultIceServers();
};</pre>
<section>
<h2>Methods</h2>
<dl data-link-for="RTCPeerConnection" data-dfn-for=
"RTCPeerConnection" class="methods">
<dt><dfn data-idl>getDefaultIceServers</dfn></dt>
<dd>
<p>Returns a list of ICE servers that are configured into the
browser. A browser might be configured to use local or private
STUN or TURN servers. This method allows an application to learn
about these servers and optionally use them.</p>
<p class="fingerprint">This list is likely to be persistent and
is the same across origins. It thus increases the
fingerprinting surface of the browser. In privacy-sensitive
contexts, browsers can consider mitigations such as only
providing this data to whitelisted origins (or not providing it
at all.)</p>
<p class="note">Since the use of this information is left to
the discretion of application developers, configuring a user
agent with these defaults does not per se increase a user's
ability to limit the exposure of their IP addresses.</p>
<p class="note">If set, the configured default ICE servers exposed by
{{RTCPeerConnection/getDefaultIceServers}} on
{{RTCPeerConnection}} instances provides persistent
information across time and origins which increases the fingerprinting
surface of a given browser.</p>
<div class="issue atrisk">
<p>
{{RTCPeerConnection/getDefaultIceServers()}} was moved from [[WEBRTC]] to
this specification due to lack of support from implementers and concerns
discussed in <a href="https://github.com/w3c/webrtc-pc/issues/2023">webrtc-pc#2023</a>.
</p>
</div>
</dd>
</dl>
</section>
</section>
<section id="rtcicecredentialtype-enum">
<h3>
{{RTCIceCredentialType}} extensions
</h3>
<p>The following enum values are added to the
{{RTCIceCredentialType}}
enum defined in [[WEBRTC]].</p>
<div>
<pre class="idl"
>// This is a partial enum, but this is not yet expressable in WebIDL.
enum RTCIceCredentialType {
"oauth"
};</pre>
<table data-link-for="RTCIceCredentialType" data-dfn-for=
"RTCIceCredentialType" class="simple">
<tbody>
<tr>
<th colspan="2">Enumeration description</th>
</tr>
<tr>
<td><dfn data-idl>oauth</dfn></td>
<td><p>An OAuth 2.0 based authentication method, as described
in [[RFC7635]].
</p>
<p>For OAuth Authentication, the <a data-cite="WEBRTC#dfn-ice-agent">ICE Agent</a> requires three
pieces of credential information. The credential is composed of
a <code>kid</code>, which the {{RTCIceServer.username}} member is used for, and
<code>macKey</code> and <code>accessToken</code>, which are
placed in the {{RTCOAuthCredential}} dictionary.
</p>
<p class="note">
This specification does not define how an application (acting
as the [=OAuth Client=]) obtains the
<code>accessToken</code>, <code>kid</code> and
<code>macKey</code> from the [=Authorization Server=], as
WebRTC only handles the interaction between the <a data-cite="WEBRTC#dfn-ice-agent">ICE
Agent</a> and TURN server. For example, the application may use
the OAuth 2.0 Implicit Grant type, with PoP (Proof-of-Possession)
Token type, as described in [[RFC6749]] and
[[OAUTH-POP-KEY-DISTRIBUTION]]; an example of this is provided
in [[RFC7635]], Appendix B.</p>
<p>
The application, acting as the <a>OAuth Client</a>, is responsible for
refreshing the credential information and updating the <a data-cite="WEBRTC#dfn-ice-agent">ICE
Agent</a> with fresh new credentials before the
<code>accessToken</code> expires. The <a>OAuth Client</a> can use the
{{RTCPeerConnection.setConfiguration()}}
method to periodically refresh the TURN credentials.</p>
<p>The length of the HMAC key
({{RTCOAuthCredential.macKey}}) MAY be any integer
number of bytes greater than 20 (160 bits).</p>
<p class="note">According to [[RFC7635]] Section 4.1, the
HMAC key MUST be a symmetric key, as asymmetric keys would
result in large access tokens which may not fit in a single
STUN message.</p>
<p class="note">Currently the STUN/TURN protocols use only SHA-1 and SHA-2
family hash algorithms for Message Integrity Protection, as
defined in [[RFC5389]] Section 15.4, and [[STUN-BIS]]
Section 14.6.</p>
<p>When <a
data-cite="WEBRTC#set-pc-configuration">setting a
configuration</a> and evaluating urls, also run the following step:
<ol>
<li>
<p>If <var>scheme name</var> is <code>turn</code> or
<code>turns</code>, and
<code><var>server</var>.{{RTCIceServer/credentialType}}</code> is
<code>"oauth"</code>, and
<code><var>server</var>.{{RTCIceServer/credential}}</code> is not an
{{RTCOAuthCredential}}, then [=exception/throw=] an
{{InvalidAccessError}}.</p>
</li>
</ol>
<div class="issue atrisk">
<p>
The {{RTCIceCredentialType/"oauth"}} value of {{RTCIceCredentialType}}
was moved from [[WEBRTC]] to this specification due to lack of support
from implementers. It is therefore marked as a feature at risk.
</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h3>
<dfn>RTCOAuthCredential</dfn> Dictionary
</h3>
<p>The {{RTCOAuthCredential}} dictionary is used to describe
the OAuth auth credential information which is used by the STUN/TURN
client (inside the <a data-cite="WEBRTC#dfn-ice-agent">ICE Agent</a>) to authenticate against a STUN/TURN
server, as described in [[RFC7635]]. Note that the <code>kid</code>
parameter is not located in this dictionary, but in
{{RTCIceServer.username}} member.</p>
<div class="issue atrisk">
<p>
The {{RTCOAuthCredential}} dictionary was moved from [[WEBRTC]] to
this specification due to lack of support from implementers. It is
therefore marked as a feature at risk.
</p>
</div>
<div>
<pre class="idl"
>dictionary RTCOAuthCredential {
required DOMString macKey;
required DOMString accessToken;
};</pre>
<section>
<h2>Dictionary {{RTCOAuthCredential}} Members
</h2>
<dl data-link-for="RTCOAuthCredential" data-dfn-for="RTCOAuthCredential"
class="dictionary-members">
<dt><dfn data-idl>macKey</dfn> of type <span class=
"idlMemberType">DOMString</span>, required</dt>
<dd>
<p>The "mac_key", as described in [[RFC7635]], Section 6.2, in
a base64-url encoded format. It is used in STUN message
integrity hash calculation (as the password is used in password
based authentication). Note that the OAuth response "key"
parameter is a JSON Web Key (JWK) or a JWK encrypted with a JWE
format. Also note that this is the only OAuth parameter whose
value is not used directly, but must be extracted from the "k"
parameter value from the JWK, which contains the needed
base64-encoded "mac_key".</p>
</dd>
<dt><dfn data-idl>accessToken</dfn> of type <span class=
"idlMemberType">DOMString</span>, required</dt>
<dd>
<p>The "access_token", as described in [[RFC7635]], Section
6.2, in a base64-encoded format. This is an encrypted
self-contained token that is opaque to the application.
Authenticated encryption is used for message encryption and
integrity protection. The access token contains a non-encrypted
nonce value, which is used by the Authorization Server for unique
mac_key generation. The second part of the token is protected
by Authenticated Encryption. It contains the mac_key, a
timestamp and a lifetime. The timestamp combined with lifetime
provides expiry information; this information describes the
time window during which the token credential is valid and
accepted by the TURN server.
</p>
</dd>
</dl>
</section>
</div>
<p>An example of an RTCOAuthCredential dictionary is:</p>
<pre class="example highlight">
<code>{
macKey: 'WmtzanB3ZW9peFhtdm42NzUzNG0=',
accessToken: 'AAwg3kPHWPfvk9bDFL936wYvkoctMADzQ5VhNDgeMR3+ZlZ35byg972fW8QjpEl7bx91YLBPFsIhsxloWcXPhA=='
}</code></pre>
</section>
<section id="rtciceserver-dictionary">
<h3>
{{RTCIceServer}} extensions
</h3>
<p>
The {{RTCIceServer}}
dictionary is defined in [[WEBRTC]]. This document extends that
dictionary by adding the {{RTCIceServer/credential}} attribute, and adds a
paragraph to how to interpret the existing {{RTCIceServer/username}}
attribute.
</p>
<pre class="idl"
>partial dictionary RTCIceServer {
// This attribute is not new in this extension spec, but how to interpret it
// in the case of credentialType being "oauth" is described here.
DOMString username;
(DOMString or RTCOAuthCredential) credential;
};</pre>
<h2>Dictionary {{RTCIceServer}} Members</h2>
<dl data-link-for="RTCIceServer" data-dfn-for="RTCIceServer" class=
"dictionary-members">
<dt><dfn data-idl>username</dfn> of type {{DOMString}}</dt>
<dd>
<p>How to interpret the {{username}} when this
{{RTCIceServer}} object represents a TURN server, and
{{RTCIceServer/credentialType}} is {{RTCIceCredentialType/"password"}} is specified
in {{RTCIceServer}} of [[WEBRTC]].</p>
<p>If this {{RTCIceServer}} object represents a
TURN server, and {{RTCIceServer/credentialType}} is
{{RTCIceCredentialType/"oauth"}}, then this attribute specifies the Key ID
(<code>kid</code>) of the shared symmetric key, which is shared
between the TURN server and the Authorization Server, as described
in [[RFC7635]]. It is an ephemeral and unique key identifier.
The <code>kid</code> allows the TURN server to select the
appropriate keying material for decryption of the Access-Token,
so the key identified by this <code>kid</code> is used in the
Authenticated Encryption of the "access_token". The
<code>kid</code> value is equal with the OAuth response "kid"
parameter, as defined in [[RFC7515]] Section 4.1.4.</p>
</dd>
<dt><dfn data-idl>credential</dfn> of type <span class=
"idlMemberType">(DOMString or {{RTCOAuthCredential}})
</span></dt>
<dd>
<p>If this {{RTCIceServer}} object represents a
TURN server, then this attribute specifies the credential to
use with that TURN server.</p>
<p>If {{RTCIceServer/credentialType}} is {{RTCIceCredentialType/"password"}},
{{credential}} is a DOMString, and represents a
long-term authentication password, as described in
[[RFC5389]], Section 10.2.</p>
<p>If {{RTCIceServer/credentialType}} is {{RTCIceCredentialType/"oauth"}},
{{credential}} is an {{RTCOAuthCredential}}, which
contains the OAuth access token and MAC key.</p>
<p>If this {{RTCIceServer}} object represents a
TURN server, and {{RTCIceServer/credentialType}} is
{{RTCIceCredentialType/"oauth"}}, then this attribute specifies the Key ID
(<code>kid</code>) of the shared symmetric key, which is shared
between the TURN server and the Authorization Server, as described
in [[RFC7635]]. It is an ephemeral and unique key identifier.
The <code>kid</code> allows the TURN server to select the
appropriate keying material for decryption of the Access-Token,
so the key identified by this <code>kid</code> is used in the
Authenticated Encryption of the "access_token". The
<code>kid</code> value is equal with the OAuth response "kid"
parameter, as defined in [[RFC7515]] Section 4.1.4.</p>
<div class="issue atrisk">
<p>
The {{RTCIceServer/credential}} attribute was moved from [[WEBRTC]] to
this specification due to lack of support from implementers. It is
therefore marked as a feature at risk.
</p>
</div>
</dd>
</dl>
<p>An example array of {{RTCIceServer}} objects is:</p>
<pre class="example highlight">
<code>{
urls: 'turns:turn2.example.net',
username: '22BIjxU93h/IgwEb',
credential: {
macKey: 'WmtzanB3ZW9peFhtdm42NzUzNG0=',
accessToken: 'AAwg3kPHWPfvk9bDFL936wYvkoctMADzQ5VhNDgeMR3+ZlZ35byg972fW8QjpEl7bx91YLBPFsIhsxloWcXPhA=='
},
credentialType: 'oauth'
}</code></pre>
</section>
<section>
<h3>
{{RTCRtpSynchronizationSource}} extensions
</h3>
<p>This document extends {{RTCRtpSynchronizationSource}} with a {{RTCRtpSynchronizationSource/voiceActivityFlag}} member (initially defined in the WebRTC 1.0 specification but later dropped due to lack of implementation).</p>
<pre class="idl">
partial dictionary RTCRtpSynchronizationSource {
boolean voiceActivityFlag;
};</pre>
<dl data-link-for="RTCRtpSynchronizationSource" data-dfn-for=
"RTCRtpSynchronizationSource" class="dictionary-members">
<dt>
<dfn data-idl="">voiceActivityFlag</dfn> of type <span class=
"idlMemberType">boolean</span>
</dt>
<dd>
<p class="needs-test">
Only present for audio receivers. Whether the last RTP
packet, delivered from this source, contains voice activity
(true) or not (false). If the RFC 6464 extension header was
not present, or if the peer has signaled that it is not using
the V bit by setting the "vad" extension attribute to "off",
as described in [[!RFC6464]], Section 4,
{{voiceActivityFlag}} will be absent.
</p>
<div class="issue atrisk">
<p>
{{RTCRtpSynchronizationSource/voiceActivityFlag}} was moved from [[WEBRTC]] to
this specification due to lack of support from implementers. It is therefore
marked as a feature at risk.
</p>
</div>
</dd>
</dl>
</section>
</section>