Skip to content

A custom authorizer for lambda to provide basic auth through to a browser

Notifications You must be signed in to change notification settings

monkut/lambda-basicauth-authorizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lambda-basicauth-authorizer

Requires

  • awscli
  • python39

Install BASIC_AUTH custom authorizer to APIGateway

Deploy and install Authorizer

  1. Create s3 bucket for custom auth function:

    RESTAPI_ID is the ID to an existing API Gateway RestAPI. List existing RestAPI Ids with the awscli command: aws apigateway get-rest-apis

    PROJECTID is a unique identifier for your project so that S3 buckets do not collide

    export BASIC_AUTH_USERNAME={YOUR USERNAME}
    export BASIC_AUTH_PASSWORD={YOUR PASSWORD}
    export PROJECTID={YOUR PROJECT IDENTIFIER}
    export RESTAPI_ID={YOUR RESTAPI ID}
    make createfuncbucket
  2. Create Package, place in bucket, integrate custom auth function to existing :

    make deploy
    make install

Update authorizer code

The following procedure is used to make updates to the deployed authorizer, should any code changes be made within the authorizer:

> Assumes you have already performed the initial _Deploy and install Authorizer_ steps above.

```bash
export BASIC_AUTH_USERNAME={YOUR USERNAME}
export BASIC_AUTH_PASSWORD={YOUR PASSWORD}
export PROJECTID={YOUR PROJECT IDENTIFIER}
export RESTAPI_ID={YOUR RESTAPI ID}
make updatefunc
```

About

A custom authorizer for lambda to provide basic auth through to a browser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published