Why is authentication working locally but not when deployed to lambda in a container? #1933
Answered
by
Mike-Gilge
Mike-Gilge
asked this question in
Q&A
-
I have an AWS Lambda function running a .net web api. I have JWT auth working via Cognito locally but when its deployed as a container to AWS its returning a 200 response and the correct content for secured endpoints even with no token passed in. I have tried all the things I can think of and im at a loss. What do folks know or suggest about this? here is my Dockerfile for good measure:
|
Beta Was this translation helpful? Give feedback.
Answered by
Mike-Gilge
Jan 20, 2025
Replies: 1 comment 1 reply
-
This is my local entry point:
This is my lambda entry point:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So anyone else who runs into this issue... I am using an API Gateway authorizer to lock down the API Gateway to only accept requests from cloud front (because im using an HttpApi and wanted a WAF as well). Turns out when you do that the APIGatewayHttpApiV2ProxyFunction class overwrites existing authorization. I was able to fix this by overriding the FunctionHandlerAsync and setting the authorizer to null on the incoming request.