AWS API Gateway custom Authorizer strange showing error

前端 未结 5 2029
悲哀的现实
悲哀的现实 2021-02-05 04:10

Here is the context:

  • I set up a resource in the API gateway. /user/company
  • This resource have 2 methods. Get and POST.
  • I have configured a custom
5条回答
  •  不要未来只要你来
    2021-02-05 04:51

    I fixed this by setting the AuthorizerResultTtlInSeconds to 0.

    The reason for this is that I was using a shared authorizer. However the authorizer worked by reading the event context of the request and granting an IAM to then invoke a specific lambda.

    Because the authorizer was shared it was caching the response which was an IAM for a specific lambda for the TTL of (in my case) 300 seconds.

    Therefore, I could call one API one minute, then not the next.

    Changing the value above to 0 fixed the issue.

提交回复
热议问题