Hi to all,
I just want to ask how to generate the securetoken hash on the https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine documentation (How to protect streaming using SecureToken in Wowza Streaming Engine) specifically the following:
“Important: The client web server should generate the hash when it generates the client webpage. You shouldn’t use JavaScript code in the client webpage to generate the hash as the code is visible in the webpage source and would pose a potential security risk.”
Can anyone provide a sample code on how to do this?
I would like also ask how did you arrive on the wowzatokenhash=m20I4XSU1Emt zHmz8PbbRsX5OcVi7Km-qI1J3acEV-c= on the RTSP example below?
From the string “vod/myInstance/sample.mp4?wowzatokenCustomParameter=abcdef&wowzatokenendtime=1500000000&xyzSharedSecret” , what operations are done to arrive at the wowzatokenhash=m20I4XSU1Emt zHmz8PbbRsX5OcVi7Km-qI1J3acEV-c= ?
RTSP example
This example is based on an RTSP VOD request where the application instance is specified in the URL. The default query parameter prefix (wowzatoken) is used, a custom public query parameter is included in the hash generation, and the SecureToken end time is specified. The client IP address isn’t included in the hash generation and the the SecureToken start time isn’t specified (SecureToken playback security is enabled immediately).
Content URL: rtsp://192.168.1.1:1935/vod/sample.mp4
Content path: vod/myInstance/sample.mp4
Custom SecureToken public query parameter: wowzatokenCustomParameter=myValue
Token end time: wowzatokenendtime=1500000000
The parameters used to create the string used for hashing (not in alphabetical order):
wowzatokenendtime=1500000000
wowzatokenCustomParameter=abcdef
xyzSharedSecret
String used for hashing (in required alphabetical order):
vod/myInstance/sample.mp4?wowzatokenCustomParameter=abcdef&wowzatokenendtime=1500000000&xyzSharedSecret
RTSP URL sent to server:
rtsp://10.0.2.31:1935/vod/myInstance/sample.mp4?wowzatokenendtime=1500000000&wowzatokenCustomParameter=abcdef&wowzatokenhash=m20I4XSU1Emt zHmz8PbbRsX5OcVi7Km-qI1J3acEV-c=
Thanks a lot for the help.
Regulus