0

My server is configured to use a static-auth-secret so I changed the WebRTC Trickle ICE example to use oauth as the credential type, and I hoped this would allow me to use the static-auth-secret for authentication.

However, I get this error now:

TypeError: RTCPeerConnection constructor: 'oauth' (value of 'credentialType' member of RTCIceServer) is not a valid value for enumeration RTCIceCredentialType.

This is what my iceServer object looks like now:

 const iceServer = {
    urls: [urlInput.value],
    credential: passcodeInput.value,
    credentialType: 'oauth'
  };

This doesn't make sense because the documentation here says credentialType can be either oauth or password.

Casey
  • 444
  • 1
  • 7
  • 22

2 Answers2

1

The OAuth credential type was removed from the WebRTC 1.0 specification for lack of implementation in browsers.

It may come back later as an extension to WebRTC 1.0.

At the moment, it is not possible to authenticate with OAuth to an ICE server in deployed browser implementations of WebRTC. See the relevant browser bugs:

dontcallmedom
  • 2,420
  • 14
  • 12
0

As @dontcallmedom mentions, oauth is not supported. So, to solve my problem of authenticating with a server using a passcode, I had to develop a Node.js Express API which generated ephemeral credentials that worked for default password ICE server authentication. Big note: this REST API is not provided by default, it is made by the user.

More detailed instructions found here

Casey
  • 444
  • 1
  • 7
  • 22