{"id":22390152,"url":"https://github.com/kkpoon/lambda-edge-basic-auth","last_synced_at":"2025-03-26T21:28:48.126Z","repository":{"id":75211938,"uuid":"115495508","full_name":"kkpoon/lambda-edge-basic-auth","owner":"kkpoon","description":"Basic Authentication at AWS Lambda@Edge","archived":false,"fork":false,"pushed_at":"2019-06-05T02:30:22.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T03:28:43.360Z","etag":null,"topics":["aws-cloudfront","aws-lambda","basic-authentication","lambda-edge"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kkpoon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-27T07:41:06.000Z","updated_at":"2019-06-05T02:30:24.000Z","dependencies_parsed_at":"2023-06-05T18:45:15.916Z","dependency_job_id":null,"html_url":"https://github.com/kkpoon/lambda-edge-basic-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkpoon%2Flambda-edge-basic-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkpoon%2Flambda-edge-basic-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkpoon%2Flambda-edge-basic-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkpoon%2Flambda-edge-basic-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kkpoon","download_url":"https://codeload.github.com/kkpoon/lambda-edge-basic-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245738221,"owners_count":20664238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cloudfront","aws-lambda","basic-authentication","lambda-edge"],"created_at":"2024-12-05T03:14:28.161Z","updated_at":"2025-03-26T21:28:48.121Z","avatar_url":"https://github.com/kkpoon.png","language":"JavaScript","readme":"# lambda-edge-basic-auth\n\nThis is a simple implementation of Basic Authentication in AWS Lambda@Edge for controlling access of CloudFront distribution.\n\nTo use this lambda, you have to config as follow\n\n1. Deploy this lambda function in `us-east-1`. The function MUST be deployed in `us-east-1` for lambda@edge.\n2. Use the following `AssumeRole` for this lambda execution role, edit in IAM / Roles / Your Lambda Execution Role / Trust Relationship\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"lambda.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"edgelambda.amazonaws.com\"\n      },\n      \"Action\": \"sts:AssumeRole\"\n    }\n  ]\n}\n```\n3. Publish a version of the lambda\n4. In CloudFront, config the distribution **Lambda Function Associations**, set the **CloudFront Event** to **Viewer Request**, set your versioned lambda ARN, and leave **Include Body** unchecked.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkpoon%2Flambda-edge-basic-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkkpoon%2Flambda-edge-basic-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkpoon%2Flambda-edge-basic-auth/lists"}