Amazon API Gateway authorization AWS_IAM

BAD_SEED picture BAD_SEED · Jun 6, 2017 · Viewed 10k times · Source

What does it means AWS_IAM as Authorization model in Amazon API Gateway?

enter image description here

If I test the Lambda inside the AWS console it works and prints "Hello World", but if I use the endpoint URL and open it inside another browser's tab it say {"message":"Missing Authentication Token"} how can I get this authentication token?

Answer

jaccus picture jaccus · Jun 7, 2017

Create a new IAM user

Go to AWS IAM and create a new user with programmatic access for accessing your API Gateway. Then attach a policy with enough permissions to the user/group to be able to access your API Gateway endpoint. Once you get through all the steps, you will be presented with a key/secret for your new user.

Make an API request with AWS Signature using Postman

Now, to simplify things, install Postman and then use the Authorization tab in your request page, to select AWS Signature:

Postman-AWS-Signature

Fill in AccessKey / SecretKey for your new user, AWS Region in which you operate (e.g., us-west-1) and click the Update Request button. At that point Postman will fill in the necessary Headers for your request and you can make authorized requests to your API Gateway.