title: Passing authentication to AWS Lambda + AWS API Gateway
body: <p>I have created a Serverless app using AWS Lambda + API Gateway + DynamoDB, by just following the example shown in the website: </p>
  
  <p><a href="https://medium.com/statuscode/serverless-ice-cream-or-create-your-serverless-node-js-micro-service-with-a-database-17a6946251e0" rel="nofollow noreferrer">https://medium.com/statuscode/serverless-ice-cream-or-create-your-serverless-node-js-micro-service-with-a-database-17a6946251e0</a></p>
  
  <p>But during the testing when I fired this command: </p>
  
  <p>~/Documents/workspaces/nodejs/ice-cream-shop
  $ curl -H "Content-Type: application/json" -X POST -d '{"icecreamId":"123", "name":"chocolate"}' <a href="https://0k213z6zp2.execute-api.us-east-1.amazonaws.com/latest" rel="nofollow noreferrer">https://0k213z6zp2.execute-api.us-east-1.amazonaws.com/latest</a></p>
  
  <p>I got this error {"message":"Missing Authentication Token"} :</p>
  
  <p>% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100    82  100    42  100    40     90     86 --:--:-- --:--:-- --:--:--   176{"message":"Missing Authentication Token"}</p>
  
  <p>I have already created aws_access_key_id &amp; aws_secret_access_key and saved it in my credentials file under the .aws folder under my user folder.
  Still I got the above error.</p>
  
  <p>Now I’m researching how to pass the authentication info to the curl command.</p>
  
  <p>Any tips/suggestions ?</p>
  
  <p>Thanks!</p>
  
  <p>I have added an Autherization Header:</p>
  
  <p>curl -H "Content-Type: application/json" -H 'Authorization: Token aws_secret_access_key=' -X POST -d '{"icecreamId":"123", "name":"chocolate"}' <a href="https://0k213z6zp2.execute-api.us-east-1.amazonaws.com/latest" rel="nofollow noreferrer">https://0k213z6zp2.execute-api.us-east-1.amazonaws.com/latest</a></p>
  
  <p>But I got this error: 
  {"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. "}</p>