How to restrict access to a static S3 site using HTTP Basic Auth?

preview_player
Показать описание
In this video we add basic auth to an s3 bucket containing a static website.

This way, the browser will display an authentication dialog and require a username and password to get access to the static site. This will protect the files on our s3 bucket and limit access to them.

We use a cloudfront distribution and a lambda edge function that checks the request being made and authenticates the user.

#basicauth #s3 #cloudfront
Рекомендации по теме
Комментарии
Автор

I thought this would take me a week to figure out. You made it possible in 45 min. Thank you!

antopolskiy
Автор

@BiteSize Academy That was excellent. only thing is that with the latest version of node (18) the default setting allows only this syntax `export const handler = async (event) => ` as opposed to exports.handler = async(event)

loficatme
Автор

Really helpful walkthrough, thank you! Just a note that I had to wait a few hours after creating the bucket and spinning up Cloudfront for DNS to propagate when using the global url for my bucket as demonstrated in the tutorial

beners
Автор

it seems that ui has changed now and there are more settings to do and permissions to add

Dudarinho
Автор

This video was just what I needed. Thanks!

martinezfg
Автор

Hi i m saranya. I have followed the steps you have expalined in the video. But still i was not login to the website it alsways asking for the credentials. How i can solve this??

saranyadec
Автор

Excellent work! Thank you for creating this.

kevinfundarek
Автор

Thank you for the information, your video is informative and concise, you cant ask for anything more.

brianhenning
Автор

Bite-Sized and perfect, thanks a lot!

anujpandit
Автор

It work as per the steps covered. I am trying to use AWS IAM or Azure AD as a authentication provider. Do you have any similar video for this?

darshank
Автор

Great video. How would I modify the code if I wanted to add an additional user and password?

creativaassociates
Автор

Hey,

Small question, what is the expected cost for this soultion? because if i got it right every naviagtion in the website requires an invokation of the lambda, so if that's the case that's not a production solution that's a solution for private access to internal portals etc

EladRovek
Автор

Nice content, thanks for the upload. Appreciated !!

nagautube
Автор

Can I use a custom login page for the same purpose?

kashifejaz
Автор

How to make that authentication window appears every time when you refresh website?

erzhan
Автор

I cannot get CloudFront to invoke the basic-auth lambda. I set the trust on the execution role. Is anyone else have the same issue?

umguy
Автор

Hi! Is there a way using this configuration to have local iframes in the website not getting ‘Access Denied’ error? Thanks!

FreddieMJFan
Автор

Please, I dont see a link in the description with the code

anesumugomba
Автор

hmmm, I get 502 ERROR => The request could not be satisfied.
Any help?

NhanNguyen_dra
Автор

how can i use cognito user pool in lambda function?

vijaymkm