1 Answer
- Newest
- Most votes
- Most comments
0
Hi, yes, it is possible. See this previous answer on exact same topic: https://repost.aws/questions/QUgItZ7VFcS1iQ5wKGeU4YqA/is-it-possible-to-throw-custom-error-message-from-api-gateway-lambda-authorizer#ANpVh0TCRnSsafEkHDhfHuow
To "select" the queries on which you want to provide your specific message, you can use the input parameters to the authorisers as per doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html
A request parameter-based Lambda authorizer (also called a REQUEST authorizer) receives
the caller's identity in a combination of headers, query string parameters,
stageVariables, and $context variables.
In your case, the query string parameters and headers will help you select your specific queries.
Best,
Didier
Relevant content
- asked 5 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Yes, that I have already figured out, as I mentioned in the post. My question is: How can I use this template just for specific resources and not the whole api gw
Hi, I edited my answer to add complements in the direction of your question. Hope it's better now!