Example of a service that uses API Gateway custom authorizer feature to authorize your endpoints.
serverless install --url https://github.com/eahefnawy/serverless-authorizer
cd serverless-authorizer
serverless deploy
- Notice the displayed endpoint after deployment
curl --header "Authorization: allow" <endpoint>
- Should work! Authorized!curl --header "Authorization: deny" <endpoint>
- Should not workcurl --header "Authorization: unauthorized" <endpoint>
- Should not workcurl --header "Authorization: blabla" <endpoint>
- Should not workcurl <endpoint>
- Should not work