I want to use coturn with oAuth. If I understood it correctly I need to do two things:
- Storing the oAuth tokens in the database coturn is using
- Sending the
ACCESS-TOKEN
andUSERNAME
STUN attributes
First point is clear but how do I need to change my WebRTC client to achieve the second point?
Without oAuth I would initialize my RTCPeerConnection
like this:
var configuration = {
'iceServers': [{
'url': 'turn:turn.example.org',
'username': 'user',
'credential': 'password'
}]
};
var pc = new RTCPeerConnection(configuration)
The WebRTC 1.0 draft defines a RTCIceCredentialType
enum so i would think I need to change my configuration like this:
var configuration = {
'iceServers': [{
'url': 'turn:turn.example.org',
'username': 'kid',
'credential': 'oAuthToken',
'credentialType': 'token'
}]
};
Using Wireshark I can't see the ACESS-TOKEN
attribute. Any ideas or does anyone know a working example?