You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 4, 2025. It is now read-only.
This plugin allows you to define your own API Gateway Authorizers as
the Serverless CloudFormation resources and apply them to HTTP endpoints.
Currently the main use case for this is to enable Cognito User Pool
authorizers, which are not yet supported by Serverless 1.0.
Installation
npm install --save serverless-plugin-cfauthorizer
Configuration (serverless.yml)
You will first need to add a custom authorizer in the custom cfAuthorizers
section of your serverless.yml. Here is an example of a Cognito User Pool
authorizer. To use this example, you need to substitute your own User Pool ARN
on the last line. Note that the properties of the authorizer are standard
CloudFormation properties, so you can use any supported values.
Once the above resource has been added, you can configure individual HTTP
endpoints in serverless.yml to use the authorizer. They will refer to it using
the resource name, which is MyAuthorizer in the example.