我根据规范设置了自定义授权程序:AWS Docs,我启用了API网关,设置了授权程序,并且可以获得授权的cloudwatch日志 .

每个调用都被重定向到看起来像我的函数的url,但只是失败了“400 bad request”:

Sending request to https://lambda.$REGION.amazonaws.com/2015-03-31/functions/arn:aws:lambda:$REGION:$AID:function:$LAMBDA/invocations
Received response. Integration latency: 1 ms
Endpoint response body before transformations: <html> <head><title>400 Bad Request</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> </body> </html>
Endpoint response headers: {Server=awselb/2.0, Date=Sun, 30 Sep 2018 04:32:01 GMT, Content-Type=text/html, Content-Length=138, Connection=close}
Lambda invocation failed with status: 400. Lambda request id: N/A

这个权限在某个地方吗? Api Gateway可以调用我的“登录”api就好了 .

如果我使用“TEST”按钮通过控制台调用目标lambda,它可以正常工作 .

有什么想法吗?