Hi Folks,
I’ve been fiddling for a week now, and I can’t seem to get the hmac authentication to work. I’ve been using the API with the simple api/access keys in the request, which was fine for testing purposes. Now I’d like to move to hmac authentication for the next level, but I always get a 401 http response:
status:
401
code:
"ERR-401-InvalidSignature"
title:
"Invalid Signature Error"
message:
"Invalid signature."
description:
""
I just don’t get what’s wrong and the wowza help is limited as I’m doing this in JavaScript and no example is provided. I can only figure out so much from the 2 examples provided on that page, but I’m doing something wrong it seems:
HMAC authentication https://www.wowza.com/docs/how-to-use-the-wowza-streaming-cloud-rest-api#hmac-authentication
This is the last current code I have, but I’ve tried a myriad of things:
import hmacSHA256 from 'crypto-js/hmac-sha256';
import Base64 from 'crypto-js/enc-base64';
export async function generateRequestSignature(requestPath, APIKey, timestamp) {
...
return Base64.stringify(hmacSHA256(timestamp.getTime() + ":" + formatedRequestPath + ":" + APIKey, APIKey));
}
requestPath contains “/api/v1.5/live_streams”
timestamp contains a value like 1593156737456
APIkey also contains the correct key.
What am I missing?