访问 API Gateway 时缺少身份验证令牌? [英] Missing Authentication Token while accessing API Gateway?

查看:47
本文介绍了访问 API Gateway 时缺少身份验证令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 AWS API Gateway 调用 Lambda 函数.当我提到身份验证类型 NONE 时,它工作正常,但 API 变得公开,任何有 url 的人都可以访问我的 API.为了使 API 调用安全,我使用身份验证类型 AWS_IAM 和还将 AmazonAPIGatewayInvokeFullAccess 策略附加到我的用户,但收到此错误:

I am trying to call a Lambda Function through AWS API Gateway. When I mention Authentication type NONE it works fine but API become public and anyone with url can access my API. To make API call secure, I am using Authentication type AWS_IAM and also attached AmazonAPIGatewayInvokeFullAccess policy to my user but getting this error:

{ message: "Missing Authentication Token"}

我不知道我在这里错过了什么.

I don't know what I am missing here.

推荐答案

我认为您是直接尝试访问 API 链接,这将不起作用,因为 API 使用 IAM 角色进行保护,您必须提供 AWS 身份验证,即访问密钥和秘钥.

I think you are directly trying to access API link, this won't work because API is secured using IAM role and you must provide AWS authentication i.e Access key and Secret key.

使用 Postman Chrome 扩展程序测试您的 API:http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-use-postman-to-call-api.html

Use the Postman Chrome extension to test your API: http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-use-postman-to-call-api.html

这篇关于访问 API Gateway 时缺少身份验证令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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