Turn server with time limited credentials

Discussion in 'Web Call Server 5' started by Peter P., Mar 17, 2020.

  1. Peter P.

    Peter P. New Member

    Hi,
    We are testing a setup with a turn server using time limited credentials.
    We can make it work when connecting to the WCS with createSession() however, if the user stays on the page for longer than our TTL
    and the stream is stopped and started (not the session). We need to update the username and credential parameters.
    It does not seem to work providing the options object with updated credentials to the function createStream()
    We have tried doing it like this:
    options.mediaOptions = {
    "iceServers": [
    {
    'url': 'turn:the-turn-server.com:443?transport=tcp',
    'username': username,
    'credential': password
    }
    ]
    };
    I am not even sure if this is even supported or the way to do it? But if it isn't we would really love the feature :)
  2. Max

    Max Administrator Staff Member

    Good day.
    A credentials can be passed to TURN server (no matter external or embedded) while establishing a new connection only. So, they must be passed on session establishing. To update username and credential parameters, you should close current session and create a new one.
  3. Peter P.

    Peter P. New Member

    Thanks for the fast answer! We have implemented that solution and it works.
    As a side note the "url" parameter is/will be deprecated, so it should probably be changed to "urls" in your guide: https://docs.flashphoner.com/display/WCS52EN/TURN server (and in my example above)
    Best regards
    Peter

Share This Page