-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpContext is null for AWS Lambda Function Handler (Executable assembly) #1665
Comments
@vladyslav-sosnov Good afternoon. I'm unsure if I understand your code, per my knowledge, CCing @normj for any inputs. Thanks, |
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
Hello, @ashishdhingra. Indeed, within this Lambda function handler, accessing HttpContext is not possible, which is the exact challenge I'm facing. I understand this might be by design, but I'm curious if there are any intentions to introduce HttpContext support. Alternatively, is there a method to inject it effectively so the context becomes available? |
@vladyslav-sosnov There are no plans to add |
@normj Hello! We need to access the session from AWS Dynamo DB Distributed Cache. Alternatively, if we use the Minimal API approach as described in #1666, we are already able to retrieve the session from the HttpContext but Minimal API does not return the correct Custom Authorizer response (as it wraps the response in the For this issue, the response is in the correct format (for a Custom Authorizer) but the session can not be retrieved. Our preference, if possible, is to be able to use the Minimal API approach (#1666) if the response could be fixed to return the correct response for a Custom Authorizer. |
Per @normj in #1665 (comment), there are no plans to add |
Comments on closed issues are hard for our team to see. |
Describe the bug
HttpContext is always null after it has been injected into AWS Lambda Function Handler. For comparison, it is populated while using the MinimalAPI approach.
Expected Behavior
HttpContext is populated with Items (and Session data when AWS DynamoDB session provider is used)
Current Behavior
HttpContext object is always null when injected in the AWS Lambda Function Handler.
Reproduction Steps
Code sample illustrating the absence of HttpContext.
Possible Solution
No response
Additional Information/Context
Alternatively, a Minimal API approach was trialed where HttpContext was populated with Items and Session data, however, it
returned a response that is incorrect for a Custom Authorizer (Raised in a separate issue)
Context
HttpContext is required to access session data.
For this purpose, AWS DynamoDB session provider has been integrated and API Gateway HTTP Payload v2.0 was used.
Apart from the use of Function Handler, the Lambda Entry Point approach was used. This approach faces the same issue as the Function Handler, where HttpContext is null.
Amazon.Lambda.AspNetCoreServer
AWS .NET SDK and/or Package version used
Targeted .NET Platform
.Net 6
Operating System and version
AWS Lambda
The text was updated successfully, but these errors were encountered: