AWS API custom autoloader not working

I created a Lambda function that I configured as "custom auth" in a method request to one of my API endpoints. When I use the "test" function of the AWS API gateway, I do not see any output from my Lambda function in the output log file.

I have "deployed" the API.

However, something happens because when I hit the api endpoint using the configured custom domain name, I get

{"message":"Unauthorized"}

However, if I delete the β€œuser out” from this endpoint and hit the same endpoint, it works!

I turned on logging in cloud mode, and it seems to show that the lambda function is not being called, but there is nothing in the apiGateway log group, but something should happen, I just don't see it.

Can someone tell me how I am debugging this?

+5
source share
1 answer
  • The Gateway Test Invoke API call function will NOT call any authorizers and will directly refer to your integration.
  • You can independently test the lambda authorizer using the Authorizer test call, available on the Authorization tab in the API Gateway console.
  • Your lambda function should return a response that includes the main identifier (primaryId) and the political document containing the list of policy instructions.

More detailed documentation on this subject can be found here .

Ritisha.

+7
source

Source: https://habr.com/ru/post/1257850/


All Articles