Help us improve the AWS re:Post Knowledge Center by sharing your feedback in a brief survey. Your input can influence how we create and update our content to better support your AWS journey.
如何为 API Gateway REST API 激活 IAM 身份验证?
2 分钟阅读
0
我想激活 AWS Identity and Access Management (IAM) 身份验证以访问我的 Amazon API Gateway (API Gateway) REST API。
简短描述
在 API Gateway 控制台中为 API 方法启用 IAM 身份验证。然后,使用 IAM 策略和资源策略为您的 API 用户指定权限。
**注意:**要手动验证使用其他工具或环境发送到 API Gateway 的请求,请使用签名版本 4 签名流程。有关详细信息,请参阅签署请求。
在 Postman 的 Authorization(授权)选项卡上,执行以下操作:
对于 Type(类型),选择“**AWS 签名”。
对于 AccessKey 和 SecretKey,输入 IAM 用户的 IAM 访问密钥 ID 和私密访问密钥。IAM 用户必须位于有权访问 API 的 IAM 组中。
在 Enter request URL(输入请求 URL)字段中,粘贴您的 API 的调用 URL。如果您对特定 API 资源的方法激活了 IAM 身份验证,则将资源名称附加到调用 URL 的末尾。