Results 1 to 2 of 2

Thread: SecureToken between client & server

  1. #1
    Join Date
    Apr 2016

    Default SecureToken between client & server

    Hello All,

    I need your help which i didnt success since yesterday to implement this option I am trying to do client-server auth with SecureToken hashing but I am always getting 403 acces denied error. I referenced below link but didnt success
    ApplicationName = LiveStream
    StreamName = myStream
    Hash Prefix= live

    in which algortihm what should i hash ? Please help me if you have any solution on this issue for better understanding.

  2. #2



    Once you've configured your Secure Token settings in Wowza Streaming Engine then you need to generate your hash on the client. As an example using PHP to create a hash to play sample.mp4 in the vod application

    Set some variables:
    PHP Code:
    $clientIP "null";  // specify an IP address if set in Secure Token in Engine
    $host "wowza-ip"// your ip/host
    $url"rtmp://".$host.":1935/"// this is an example for RTMP streams
    $stream "vod/_definst_/mp4:sample.mp4"// your stream
    $start time(); // token is valid from time of hash generation
    $end strtotime("+30 minutes"); // token will expire in 30 minutes
    $secret "abcde"// secret as defined in Engine
    $tokenName "wowzatoken"// token as defined in Engine 

    Calculate the hash (using sha384 or change to what is set in Wowza)
    PHP Code:
    $hash ""
    $hash hash('sha384'$stream."?".$secret."&{$tokenName}endtime=".$end."&{$tokenName}starttime=".$starttrue); // generate the hash string
    else {
    $hash hash('sha384'$stream."?".$clientIP."&".$secret."&{$tokenName}endtime=".$end."&{$tokenName}starttime=".$starttrue); // generate the hash string

    $base64Hash strtr(base64_encode($hash), '+/''-_'); $params = array("{$tokenName}starttime=".$start"{$tokenName}endtime=".$end"{$tokenName}hash=".$base64Hash);
    $params[] = $clientIP;
    sort($params); $URL $url.$stream."/playlist.m3u8?"// determine if HLS or RTMP depending on $url
    $playbackURL $url.$stream."?";

    $params as $entry){
    $playbackURL.= $entry."&";
    $URL preg_replace("/(\&)$/",""$playbackURL); 
    This will create a $URL line similar to this:


    you should then be able to test playback, or extend the script to include a player, e.g. JWPlayer etc.


Similar Threads

  1. Replies: 1
    Last Post: 04-13-2015, 05:42 AM
  2. Is it possible to know the latency between client and server for HLS?
    By PerryASD in forum Live Streaming and Encoders
    Replies: 2
    Last Post: 10-13-2014, 11:19 AM
  3. wowza & ffmpeg & debian6 & digitalocean
    By acoliveira in forum Live Streaming and Encoder Discussion
    Replies: 3
    Last Post: 10-02-2014, 11:01 AM
  4. Monitoring & Restricting Server Connections & Altering Video Bitrate
    By sgopalkr in forum Performance Tuning Discussion
    Replies: 15
    Last Post: 10-22-2012, 04:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts