如何使用Cognito对Postman for Api Gateway中的设置头进行身份验证? [英] How setup header in Postman for Api Gateway authenticated with Cognito?

查看:193
本文介绍了如何使用Cognito对Postman for Api Gateway中的设置头进行身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将AWS Identity Pool与Facebook提供程序一起使用来对客户端进行身份验证。我需要使用Api Gateway调用AWS Lambda。从Cognito,使用Facebook令牌,我收到了凭据:AccessKeyId,SecretKey和SessionToken。

I use AWS Identity Pool with Facebook provider to authenticate client. I need to invoke AWS Lambda using Api Gateway. From Cognito, using Facebook token, i received credentials: AccessKeyId, SecretKey and SessionToken.

使用此凭据,我应该如何设置标头请求以调用我的Lambda?

Using this credentials, how should I setup header request to invoke my Lambda?

Api网关设置(测试调用我的lambda)

Api Gateway setup (test calls my lambda)

我尝试调用我的api,它返回请求中包含的安全令牌无效。

I try to call my api, it returns "The security token included in the request is invalid."

谢谢!

推荐答案

您必须在Postman中手动设置 x-amz-security-token ,然后在该标头中传递令牌。

You have to manually set 'x-amz-security-token' in Postman and pass the token in that header.

这篇关于如何使用Cognito对Postman for Api Gateway中的设置头进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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