What does it means AWS_IAM
as Authorization model in Amazon API Gateway?
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?
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.
Now, to simplify things, install Postman and then use the Authorization
tab in your request page, to select 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.