AWS Cognito And S3 Authentication

390 views Asked by At

How to securely upload image to S3 bucket from my IOS app built using Swift3.2. I have been using AWSCognito and S3 to upload but without using any authentication.I have a custom login for my app.Anyone who uses my app can upload image to S3.Also if anyone uses my website also can use the same S3.Is there any way in which I achieve this.I don't want to make my S3 bucket as public.

1

There are 1 answers

0
Susheel P On

Look at this solution from AWS Labs

https://github.com/aws-samples/cloudfront-authorization-at-edge

  • It adds an authentication layer before your static site
  • Redirects user to Cognito hosted UI if user is not authenticated instead of serving the asset from S3