4

I am currently working on to upgrade dotnet core framework version from 1.0 to 2.1 of an existing product. The UI of the same is made in Angular which makes service calls to AWS Lambdas (made using dotnet core) for all the requirements. User data is stored in AWS Cognito and every time a service call is made it first gets verified by fetching data from Cognito. This part stopped working after the framework upgrade.

The following lines of code stopped fetching data:

if (!HttpContext.Items.Keys.Contains("APIGatewayRequest"))
{
    //Log error
}
HttpContext.Items["APIGatewayRequest"] as APIGatewayProxyRequest;

Custom api gateway authorizer is used for Cognito and also HttpContext is used inside a controller.

The following image shows the Request.HttpContext structure for me: enter image description here

Any information around this issue will be great.

1 Answer 1

2

Finally, after trying desperately for a couple of days, I got the resolution. In the newer version of DotNet Core the value of the HttpContext key got changed from "APIGatewayRequest" to "LambdaRequestObject" causing all the pain. And the code was using the value directly from a constant declared inside the project and was not using the constant "AbstractAspNetCoreFunction.LAMBDA_REQUEST_OBJECT" provided by the framework.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.