是否可以在未经授权的情况下自定义API网关自定义授权者响应消息和状态代码? [英] Is it possible to customize API Gateway custom authorizer response message and status code on unauthorized?

查看:98
本文介绍了是否可以在未经授权的情况下自定义API网关自定义授权者响应消息和状态代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将状态代码设置为429,并从API网关自定义授权者返回自定义消息?

How do I set the status code to 429 and return a custom message from an API Gateway custom authorizer?

推荐答案

此处的功能有所限制.但是我发现通过编辑403和401状态代码的Gateway Responses.我的自定义消息会显示给用户.

The functionality here is a bit limited. But I've found that by editing the Gateway Responses for the 403 and 401 status codes. My custom message gets shown to users.

例如,通过保存以下内容并重新部署API.现在,当lambda授权者返回拒绝策略时,我会收到自定义消息.

For example, by saving the below and re-deploying the API. I now get my custom message when the lambda authorizer returns a deny policy.

这篇关于是否可以在未经授权的情况下自定义API网关自定义授权者响应消息和状态代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆