Manage user authentication for ultra low latency streams with the Wowza Streaming Cloud REST API

When you broadcast an ultra low latency stream that is pulled into the  Wowza  Streaming Cloud™ service, you have control over  whether or not  the source encoder or IP camera must use user authentication in order to publish the stream. User authentication provides a secure connection from the source encoder into the ingest origin server for Wowza Streaming Cloud and prevents third parties from connecting to and altering your stream.

This article shows you how to use the Wowza Streaming Cloud REST API to create an ultra low latency stream target that accepts an authenticated connection from a source encoder or IP camera’s RTMP or RTSP stream. It also suggests next steps to secure ultra low latency streams during playback.

Notes:
  • Ultra low latency streaming is available through subscription to Wowza Streaming Cloud with Ultra Low Latency. For more information see About ultra low latency streaming with Wowza Streaming Cloud.
  • For ultra low latency streams, user authentication is available for pull connections, where Wowza Streaming Cloud pulls your stream from the encoder or IP camera. This feature is dependent on the user authentication functionality of your source encoder or camera. User authentication is not currently available for push connections for ultra low latency streams.

Configure your source encoder or IP camera for user authentication


  1. Refer to documentation for your source encoder or IP camera to determine available methods for user authentication, such as defining a username and password.
  2. Implement authentication on the source encoder or camera. Your authentication information must fit into the source URL value described in the next section. Authentication information included in the source URL can only contain alphanumeric, period (.), underscore (_), and hyphen (-) characters. 

Create an ultra low latency stream target


  1. Using the Wowza Streaming Cloud REST API, create an ultra low latency stream target with a source_delivery_method of pull.
    • In the POST /stream_targets/ull request, insert your authentication information for the source encoder or IP camera, such as username and password, into the source_url value. Refer to documentation for your encoder or camera for information on the syntax of the source_url.
    • The source_url for your camera or encoder must include a publicly accessible hostname or IP address.
    See  the Wowza Streaming Cloud REST API reference documentation for detailed information about available parameters. 

    Example request and response

    Notes:

    • Ultra low latency stream targets are not available in the sandbox environment, so be sure to use https://api.cloud.wowza.com not https://api-sandbox.cloud.wowza.com in your API request.
    • Use the /stream_targets/ull endpoint instead of the /stream_targets endpoint to create an ultra low latency stream target.
    • For [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
    • For [version], substitute the version number of the API that you're using. For the current version, use v1.2.

    Create an ultra low latency stream target:

    curl -H "wsc-api-key: [key]" -H "wsc-access-key: [key]" -H "Content-Type: application/json" -X POST -d '{   
    "ull_stream_target": {  
       "name": "My Ultra Low Latency Stream Target with source security", 
       "source_delivery_method": "pull",  
       "enable_hls": true, 
       "source_url": "rtsp://username:password@123.233.456.205/media/video1"  
        }  
    }' "https://api.cloud.wowza.com/api/[version]/stream_targets/ull" 

    The request creates an  ultra low latency stream target with an  id  parameter, ingest connection details, and playback details, including a hash of playback URLs. You will need details from this response to configure  Wowza  Player to test the connection.  The response should look something like this: 

    { 
        "ull_stream_target": { 
            "id": "zsz193rv", 
            "name": "My Ultra Low Latency Stream Target with source security", 
            "enabled": true, 
            "state": "stopped", 
            "source_delivery_method": "pull", 
            "source_url": "rtsp://username:password@123.233.456.205/media/video1", 
            "playback_urls": { 
                "ws": [ 
                    "ws://edge.cdn.wowza.com/live/_definst_/0P1p2VGsyT0VjT3FFd3FwY3BPejB573f/stream.ws", 
                    "wss://edge.cdn.wowza.com/live/_definst_/0P1p2VGsyT0VjT3FFd3FwY3BPejB573f/stream.ws" 
                ], 
                "wowz": [ 
                    "wowz://edge.cdn.wowza.com/live/_definst_/0P1p2VGsyT0VjT3FFd3FwY3BPejB573f", 
                    "wowzs://edge.cdn.wowza.com/live/_definst_/0P1p2VGsyT0VjT3FFd3FwY3BPejB573f" 
                ], 
                "hls": [ 
                    "https://[wowzasubdomain]-i.akamaihd.net/hls/live/687315/0P1p2VGsyT0VjT3FFd3FwY3BPejB573f/playlist.m3u8" 
                ] 
            }, 
            "enable_hls": true, 
            "created_at": "2018-08-09T22:32:30.000Z", 
            "updated_at": "2018-08-09T22:32:30.000Z", 
        } 
    }

Test the connection


  1. Start the source encoder and camera to provide a stream for Wowza Streaming Cloud to pull.
  2. Use Wowza Player Builder for Ultra Low Latency to preview your stream. See Configure Wowza Player for Wowza Streaming Cloud ultra low latency streams for instructions.

Configure secure playback


To increase security on the playback side, see Manage secure playback for ultra low latency streams with the Wowza Streaming Cloud REST API.