【发布时间】:2021-02-17 15:19:01
【问题描述】:
我正在尝试将 API GW v2 HTTP API 与旧版(有效负载版本 1.0)自定义 lambda 授权器集成。它能够调用自定义 lambda 授权程序,但在网关日志中低于响应 ($context.authorizer.error),状态为 500 ($context.authorizer.status https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html)-
The response from the Lambda Authorizer function doesn't match the format that API Gateway expects. Invalid value for 'context'
这表明它不遵守此处提到的响应格式- https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.payload-format-response
但同样的旧版 lambda 可以在 API GW v1 REST API 上正常工作。也无法启用像 REST API 这样的执行日志,因此如果它没有返回正确的响应,则无法看到 lambda 返回的实际响应,但我对此表示怀疑。
【问题讨论】:
标签: aws-lambda aws-api-gateway