I am new to Node.js and currently using aws-cloudfront-sign package. It is working on public buckets. But when I am using private folders, it said Access Denied.
var cf = require('aws-cloudfront-sign');
var options = {
keypairId: KEY,
privateKeyPath: PATHTOPEMFILE
};
cf.getSignedUrl(CLOUDFRONTURL + directory + file, options);
It return a signedURL but showing Access Denied. What am I doing wrong? Or, is there any other way for S3 with Cloudfront SignedURL. Thanks.
It sounds like you maybe confusing signed URLs with origin access identities. Based on your description, it sounds like S3 is returning access denied to CloudFront because the folder/bucket is private. I would recommend taking a look at the documentation on configuring origin access identities, OAI.