我有一个使用自定义授权方的 AWS API 网关,如果请求获得授权,它会触发另一个 lambda 函数。从昨天开始,每当我调用 API 时,都会收到一条错误消息 { "message": null }
和 500 Internal Server Error。在响应 header 中显示 x-amzn-ErrorType →AuthorizerConfigurationException
。我可以在日志中看到调用了授权方并返回了有效策略,并且未触发其他 lambda 函数。我没有(有意)更改授权人。谁能给我提示这里可能出了什么问题?我读过this问题,但错误是返回的政策格式错误,而我没有更改我的授权人并且它之前有效。
最佳答案
策略文档的上下文部分只能包含字符串、 bool 值或数字值。数组和对象是非法的。
文档指出:
The returned values are all stringified. Notice that you cannot set a JSON object or array as a valid value of any key in the context map.
关于amazon-web-services - 具有自定义授权方的 AWS API Gateway 返回 AuthorizerConfigurationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51187864/