【发布时间】:2021-02-08 17:04:12
【问题描述】:
问题:OAuth 范围在使用 Cloudformation 和 AWS-SAM 的方法请求设置中为空
显然,我可以在一些地方声明我的授权范围,如果我做对了,我应该在授权方声明所有范围,以及我想在我的 Function 模板中为每个函数指定的范围。
这是我要修复的模板:
MyServerlessFn
Type: AWS::Serverless::Function
Properties:
FunctionName: helloWorldFn
Description: my test using cognito.
Handler: src/handlers/helloWorld.handler
Runtime: nodejs12.x
Events:
ApplicationPostAPI:
Type: Api
Properties:
Auth:
AuthorizationScopes:
- https://foobar.acme.net/full-api
Method: POST
Path: /hello/world
RestApiId: !Ref MyServerlessApi
使用 sam cli 我可以验证、构建和部署这个模板,但是当我使用 AWS Web 控制台检查它时,oauthScopes 是空的。
【问题讨论】:
标签: amazon-cloudformation aws-serverless aws-sam aws-sam-cli