如何在 Postman 中为 Api Gateway 设置标头通过 Cognito 进行身份验证? [英] How setup header in Postman for Api Gateway authenticated with Cognito?
问题描述
我使用 AWS 身份池和 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.
这篇关于如何在 Postman 中为 Api Gateway 设置标头通过 Cognito 进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!