我成功地部署了一个Cognito User Pool,并使用它对我在API网关中设置为API代理的方法进行了身份验证,现在我正在创建同一堆栈的Cloudformation模板。使用Cloudformation,我设置了API网关和使用我的用户池的Authorizer。工作正常。Setting the authorization type to CUSTOM
or COGNITO_U
我在我的API中使用了cognito,并使用serverless来配置api。为了给函数添加一个自动生成器,我找到了这个代码(How to configure my Serverless YML to use my APIGateway Authorizer?)arn: arn:aws:cognito-idp:XXXXXXXXX:XXXXXXXXXX:userpool/XXXXXXX_XXXXXXX
type: token这段代码非常好用