By using AWS re:Post, you agree to the Terms of Use

Authentication in Static Website Hosting


Hello, I was recently working with static website hosting in S3 and getting some authentication through Cognito so that only authenticated people can access the webpage. I successfully used the Cognito to authenticate users but what if someone directly accesses the page with the direct URL. For example If someone visits this URL then they can access the webpage and see the contents. What I need is, only authenticated person can access this page & if some unauthenticated person tries to access it then it shows them "Access Denied" Error or redirect them to login.html. Should I use Cloudfront or there's any other way I can achieve this?

asked 3 years ago462 views
3 Answers

Yes, you will need to use CloudFront to secure the access to your S3 bucket. You will need to follow the steps here:

answered 3 years ago

Thank You

answered 3 years ago

For a Cognito-based approach, I used the method described in

Edited by: JohnMcGehee on Aug 22, 2020 3:01 PM

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions