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

Alexander Karpov picture Alexander Karpov · Oct 24, 2017 · Viewed 18.2k times · Source

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)

enter image description here

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

enter image description here

Thank you!

Answer

Vijayanath Viswanathan picture Vijayanath Viswanathan · Oct 25, 2017

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