0
votes

I have created a AWS Lambda function and a API Gateway to invoke that function.

In the Resource tab of the APIGateway, if I invoke test, then the test successfully passed and return 200 status but if I deploy the API and invoke the URL mentioned there, I got the following error:

{"message":"Missing Authentication Token"}

Please let me know if I need to pass more information.

1
Did you add an authorizer in integration request section? - Ashan
No. Please help me what is the role of the authorizer. - Abhishek Mittal
If you add an authrizer, it will require to send a Authorization header, which will be validated. How the validation works depends on the authorizer you add e.g IAM, CognitoAuthorizer, CustomAuthorizer. - Ashan
I just added the authorizer, and passed method.request.header.Authorization in the "Identity token source". There is nothing like the type of authorizer , which you have mentioned. It did not help. - Abhishek Mittal
Sorry my bad, check in method request for auth method (Not in integration request) whether its set or not - Ashan

1 Answers

0
votes

If methods are defined on child resources and not on the root resource itself, choosing the Invoke URL link will return a {"message":"Missing Authentication Token"} error response. In this case, you must append the name of a specific child resource to the Invoke URL link. It means along with the url generated by API gateway append your resourse name.