-1

So I am trying trying to execute a PutItem request from my AWS API Gateway. I am trying to do this by using the path /storeid/{username}/{password}. I have done the mapping as json and the test within the API works perfectly and I see my data show up in my DynamoDB table but when I deploy the API and try to invoke this request I receive the following response: {"message":"Missing Authentication Token"}. This request does not have any authorization or API key requirement. Why does the test work but not the url when invoked. ps-yes I entered the correct url

Please help!

  • Does this answer your question? [Missing Authentication Token while accessing API Gateway?](https://stackoverflow.com/questions/39655048/missing-authentication-token-while-accessing-api-gateway) – JD D Oct 06 '20 at 00:54

1 Answers1

1

A few things to check

  1. Verify that Authorization is set to None (i.e. not IAM) in your Method request settings.
  2. Verify that you deployed your API changes to your stage. Using the console, click Actions -> Deploy API.
  3. Once deployed the URL to use should be displayed when you select the Stage that you deployed to. Verify you are using the correct URL.

Also, side note, it is a really bad idea to be putting passwords in your URL path or query parameters. Consider doing sending the data in the request body as a POST and doing something like HTTPS and hashing to protect the password.

JD D
  • 7,398
  • 2
  • 34
  • 53
  • Sorry I didn't provide context behind this question. I am doing this for a school project so the data will all be made up and used only by my project team and I. I have done your steps 1 trough 3 many times. I still get the missing token message. I listed the method as a post and the action is PutItem. Not sure what else I can do, I have been researching/trying this for a week and I have not been able to figure it out. – Joshua Meier Oct 06 '20 at 01:01
  • read through the various answers on the link that I added in the comments, there are many reasons for the missing authentication token – JD D Oct 06 '20 at 01:08
  • also, if you are listing your action as a POST, hitting the URL on a browser is performing a GET and won't work.. how are you invoking the POST request? Perhaps try something like [Postman](https://www.postman.com/downloads/) – JD D Oct 06 '20 at 01:10
  • The link you sent I have already read and it did not apply to me. Would there be a difference if I changed the request to a PUT? i will look into Postman as I saw some youtube videos of people using it, I just had no idea what it was. Thank you so muchg for responding and the help by the way!!!! – Joshua Meier Oct 06 '20 at 01:19
  • PUT wouldn't make a difference here, a browser URL request is a GET by default and you'll need to do something different to make a "POST" or "PUT" request. Postman should do the trick and is a popular tool to test REST APIs that allows you to specify the HTTP action, and add headers and a body to your request without having to write explicit code to test – JD D Oct 06 '20 at 01:22
  • I ahte to ask more, but I used postman and am able to test the api and it is functioning properly from postman. Do I just use the code part to execute this post request or is there something else I need to do? Sorry, still really new to this kind of programming – Joshua Meier Oct 11 '20 at 01:58