I have a trial account. I have setup an EC2 instance of the wowza streaming engine. I source a live stream to it and view the stream on an android application I have created.
Without the secure token v2 this works absolutely fine. but when I enabled secure token for the playback stream. I am not able to view the stream through my android application.
I have followed the steps as per this:
https://www.wowza.com/docs/how-to-protect-streaming-using-securetoken-in-wowza-streaming-engine#hash
I create a hash of this string:
live/livestream?livesharedsecret&wowzatokenCustomParameter=livestream
I have also verified the hash that gets generated from my code and a third party tool are the same.
I generate the hash using SHA-256 and then base64 it to a string.
md = MessageDigest.getInstance("SHA-256");
String text = "live/livestream?livesharedsecret&wowzatokenCustomParameter=livestream";
md.update(text.getBytes("UTF-8"));
byte[] hash = md.digest();
String base64 = Base64.encodeToString(hash, Base64.DEFAULT);
String url = "rtsp://xx.xx.xx.xx:1935/live/livestream?";
String finalUrl = url + "wowzatokenCustomParameter="+customParameter+"&wowzatokenhash="+base64;
Also is there any logging I can get activated on the wowza streaming engine side that can help me verify the token.
I checked the logs folder on my server and found ModuleCoreSecurity in the logs but it didn’t have the hash calculation the server should do. This is an example I found in other posts on the forum but could not find in my logs.
2017-03-0723:04:19 UTC comment server INFO 200-[vod/definst]ModuleCoreSecurity:hashCalculated: jbGXphGTxO570_89Y_dpBTA1KUCtTGdVCKXXHjTkhDU=—0.029-------------------------
2017-03-0723:04:19 UTC comment server INFO 200-[vod/definst]ModuleCoreSecurity:string hashed: vod/sample.mp4?mySharedSecret&myTokenPrefixCustomParameter=abcdef&myTokenPrefixendtime=1500000000&myTokenPrefixstarttime=1395230400—0.029------------