I am trying to allow access to assets from a presigned URL but I am unsure of how to do this. From this page I can see I need the following:
Authorization = "AWS" + " " + AWSAccessKeyId + ":" + Signature; Signature = Base64( HMAC-SHA1( YourSecretAccessKeyID, UTF-8-Encoding-Of( StringToSign ) ) ); StringToSign = HTTP-Verb + "\n" + Content-MD5 + "\n" + Content-Type + "\n" + Date + "\n" + CanonicalizedAmzHeaders + CanonicalizedResource; CanonicalizedResource = [ "/" + Bucket ] + <HTTP-Request-URI, from the protocol name up to the query string> + [ subresource, if present. For example "?acl", "?location", "?logging", or "?torrent"]; CanonicalizedAmzHeaders = <described below>
I know how to find the AWSAccessKeyId and the YourSecretAccessKeyID but how do I encode it using HMAC-SHA1 to form the final signature?
s3.getSignedUrl('getObject', params, function (err, url) { console.log("The URL is", url); });but that is to download the file, I just need to be able to display it in a browser