'How to use CloudFront distribution to upload files to backing S3 storage?
I have a Cloudfront distribution backed by S3 storage. CloudFront supports POST content-uploads as mentioned here: https://aws.amazon.com/blogs/aws/amazon-cloudfront-content-uploads-post-put-other-methods/
Couple of issues using this -
- I've enabled the settings as mentioned in the link above, but using Postman, I get 403
- Even if I make it work, what will be the 'secure' way to upload files using CloudFront so that only authenticated users are able to upload to it.
Please note that, am trying to create a mobile application, that uses the above config as its backend. So, users on the mobile app are already authenticated using OAuth with Google/Facebook etc providers.
Solution 1:[1]
Check the bucket's policy. You must allow
PutObject.That's not really related to CloudFront or S3. Before the action of POST-ing the content, you need to validate that the user is properly authenticated and authorized to do such action.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | The Illusive Man |
