近期在修改 api-gateway 中 custom authorizer 回傳的錯誤訊息。
原本是希望可以回傳 http status code 400 的錯誤,試了一段時間後。因為是以 custom authorizer 的方式實作,在 auth 中,僅能回傳 401 & 403 的錯誤
Reference
- Introducing custom authorizers in Amazon API Gateway | AWS Compute Blog overall 的說明 blog
- awslabs/aws-apigateway-lambda-authorizer-blueprints: Blueprints and examples for Lambda-based custom Authorizers for use in API Gateway. 以這份參考,來修改 python custom authorizer 的實作
- Use API Gateway Lambda authorizers - Amazon API Gateway 使用 lambda 來實作 api-gateway custom authorizer 的說明文件
- Output from an Amazon API Gateway Lambda authorizer - Amazon API Gateway lambda authorizer 回傳的結果。
- 其中回傳 json 中,所帶的
context
資料,會傳到下個 lambda 的event
變數中
- 其中回傳 json 中,所帶的