Draft
This page is not complete.
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The RTCIceServer
dictionary's credentialType
property is a string value from the RTCIceCredentialType
enum which indicates what type of credential the RTCIceServer.credential
value is. The default is "password".
var iceServer = { ... credentialType = ["password" | "token"], ... }; var credential = iceServer.credentialType; iceServer.credential = ["password" | "token"];
The RTCIceCredentialType
enum specifies values which can be returned by the credentialType
property to define what kind of authentication credential is being provided in the RTCIceServer.credential
property. This can be one of the values below.
Constant | Description |
---|---|
"password" | The credential is a long-term authentication password. See RFC 5389, section 10.2 for further details on this type of credential. |
"token" | The credential is an access token to be used with a third-party authentication system. |
This example creates a new RTCPeerConnection
which will use a TURN server at turnserver.example.org
to negotiate connections. Logging into the TURN server will use the username "webrtc" and the creative password "turnpassword".
myPeerConnection = new RTCPeerConnection({ iceServers: [ { urls: "turn:turnserver.example.org", // A TURN server username: "webrtc", credential: "turnpassword", credentialType: "password" } ] });
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCIceServer.credential' in that specification. | Working Draft | Initial specification. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Yes) | 47 (47)[1] | ? | ? | ? |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | (Yes) | 47.0 (47)[1] | ? | ? | ? |
[1] Although support for this property was added in Firefox 47, Firefox continues to only support password authentication, regardless of what you set the credential type to. See bug 1247616.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer/credentialType