WebSocket API Gateway Cognito Authorizer
MIT License
Authorize Access to WebSocket API Gateway with Cognito: Medium
npm i
npm run build
npm run package
Upload authorizer-function.zip
as source code for the Lambda.
npm i
npm start
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "execute-api:Invoke",
"Effect": "Allow",
"Resource": "arn:aws:execute-api:us-east-1:1234567890:abc123/production/*"
}
]
}
Where:
us-east-1
- region,1234567890
- account,abc123
- API Gateway ID,production
- stage.npm install -g wscat
wscat -c 'wss://abc123.execute-api.us-east-1.amazonaws.com/$default'