[{"data":1,"prerenderedAt":66},["ShallowReactive",2],{"pattern-apigw-lambda-authorizer-sam-nodejs":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":34,"level":35,"meta":36,"patternArch":37,"resources":51,"s3URL":60,"services":6,"stem":61,"testing":62,"videoId":6,"__hash__":65},"patterns\u002Fpatterns\u002Fapigw-lambda-authorizer-sam-nodejs.json","Amazon API Gateway REST API with AWS Lambda authorizer",null,{"text":8},[9],"Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Falbert-blaya.json",{"text":13},[14],"Deploy the stack: \u003Ccode>sam deploy\u003C\u002Fcode>.","Create a REST API Gateway with a Lambda Token Authorizer for access control","json","AWS SAM",{"template":19},{"projectFolder":20,"repoURL":21,"templateURL":22,"templateFile":23},"apigw-lambda-authorizer","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fapigw-lambda-authorizer","serverless-patterns\u002Fapigw-lambda-authorizer","template.yaml",{"headline":25,"text":26},"How it works",[27,28,29,30,31,32,33],"This pattern deploys an Amazon API Gateway REST API endpoint that uses a Lambda Token Authorizer for access control.","If the request to the endpoint does not include a 'authorizationToken' header, the Lambda Authorizer will not be invoked and API Gateway will return a 401 Forbidden.","If the request to the endpoint includes a 'authorizationToken' header, the Lambda Authorizer will be invoked and its response will depend on the value of the 'authorizationToken' header.","If the value of 'authorizationToken' header is 'unauthorized', API Gateway will return a 401 Unauthorized error.","If the value of 'authorizationToken' header is 'Bearer deny', API Gateway will return a 403 error.","Only if the value of 'authorizationToken' header is 'Bearer allow', API Gateway will successfully invoke the Lambda integration and return a 200.","For any other case, API Gateway will return a 500 error.","Node.js","200",{},{"icon1":38,"icon2":43,"line1":47},{"x":39,"y":40,"service":41,"label":42},20,50,"apigw","API Gateway REST API",{"x":44,"y":40,"service":45,"label":46},80,"lambda","AWS Lambda",{"from":48,"to":49,"label":50},"icon1","icon2","Auth",{"headline":52,"bullets":53},"Additional resources",[54,57],{"text":55,"link":56},"Controlling access to a REST API with a Lambda Token Authorizer","https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Fapigateway-use-lambda-authorizer.html",{"text":58,"link":59},"Lambda Function Handler","https:\u002F\u002Fdocs.aws.amazon.com\u002Fwhitepapers\u002Flatest\u002Fserverless-architectures-lambda\u002Fthe-handler.html","https:\u002F\u002Fda-public-assets.s3.amazonaws.com\u002Fpatterns\u002Fapigw-lambda-authorizer-sam-nodejs\u002Fcloudformation.yml","patterns\u002Fapigw-lambda-authorizer-sam-nodejs",{"text":63},[64],"See the GitHub repo for detailed testing instructions.","CTJj9QMwPuiMdfAredZPd7-3x92TAXk0fkyA40xc_98",1778846882037]