How setup header in Postman for Api Gateway authenticated with Cognito?

拈花ヽ惹草 提交于 2019-11-30 03:48:13

问题


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.

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

Api Gateway setup (test calls my lambda)

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

Thank you!


回答1:


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




回答2:


Please try this for postman:

http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-use-postman-to-call-api.html

you choose the AWS Signature option in the Authorization drop-down, and fill out the fields using the key and secret, click update. Postman will sign the request for you.

And also make sure the role being assigned to your cognito users has access to invoke apig.




回答3:


JoshuaC and Vijayanath Viswanathan thank you both. Following your suggestion I resolved the issue.

I did the follow steps:

  1. Setup AWS Signature and click on "Update Request"

  1. Add in header "X-Amz-Security-Token" with SessionToken



来源:https://stackoverflow.com/questions/46919965/how-setup-header-in-postman-for-api-gateway-authenticated-with-cognito

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!