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?
turnserver -n -f -v -l stdout -a --oauth -r "myRealm" -J "myMongoConnection"
– Rattoon401
error in the TURN server logs – Ranunculus26: session 005000000000000001: realm <myRealm> user <my<user>: incoming packet message processed, error 401: Unknown error 26: check_stun_auth: user turn credentials are incorrect
. I thought that coturn is using long term credentials here because theACCESS-TOKEN
attribute is not sent. – Rattoonmac_key
as credential, also for some reason, suspect that it is checking the tableturnusers_lt
instead ofoauth_key
then again, I am only guessing. – Ranunculusikm_key
value as credential. My guess is that it's checkingturnusers_lt
because my client doesn't tell that he wants to use oauth because the credential is not passed asACCESS-TOKEN
. My guess is that the client is doing it wrong not the server. – Rattoon