'AWS API Gateway {"message":"Missing Authentication Token"}
I am using API Gateway to build a REST API to communicate with a deployed aws sagemaker model via aws lambda. When I test the Method (Method Test Results) my lambda function returns the required results. I've definitely deployed the API and I'm using the correct invoke URL with the resource name appended (Method Invoke URL). Finally I have checked all the auth settings for this method request (Method Auth Settings). When I input the invoke URL into the browser or try to call the REST API (from cloud9 IDE -- a web app I am developing) I get this error: {"message":"Missing Authentication Token"} (URL Response)
My API is very simple, only one POST request, it does not contain any other resources or methods. I tried also setting up the method under '/' but had the same issue.
There are a lot of people out there with this issue, and I've spent a while reading through similar posts - but the solutions boil down to the issues I've checked above. If anyone could help it would be greatly appreciated!
Iain
Solution 1:[1]
For the benefit of anyone else who's as silly as I am, the other reason you may get this error is that you're requesting a URL that isn't configured.
For instance, you've set up a proxy API on / that sends requests through to your backend, and the path to that is https://mumblemumble/prod, and you request https://mumblemumble/prod itself instead of https://mumblemumble/prod/your/resource, you'll get this error.
Solution 2:[2]
Another potential reason is an error being thrown by the Lambda function code. I had a similar issue and it turned out to be a TypeError in my python code. You can check CloudWatch logs to gain more information.
Solution 3:[3]
In my case, the url isn't the correct one. From Aws APIs, goto your api, goto the "stages" your method, find the "invoke URL", then use it in postman.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | evgeni tsvetanov |
| Solution 3 | Feng Zhang |
