title: Trying to password protect my static website hosted on S3
body: <p>I have a cloudfront distributing which is linked to my S3 bucket on which my website is hosted.I wanted to password protect my website so I created a lambda function with authorization code and attached it to my cloud front distribution. Now When I open my website I get prompted to type user and password but when I type user and password I get again prompted to type the user and password and I am not able to access my website. This is very strange. This is the link to the tutorial which I followed</p>
  <pre><code>https://hackernoon.com/serverless-password-protecting-a-static-website-in-an-aws-s3-bucket-bfaaa01b8666
  </code></pre>
  <p>Anyone has any idea what could be the cause of this? Any help would be appreciated.</p>