aws / aws/aws-lambda-dotnet

deserialization issue affecting APIGatewayCustomAuthorizerContext

Open
#1,141 4 comments 0 reactions 0 assignees View on GitHub
bug module/lambda-client-lib needs-investigation p2 queued
Dominant language
C#
Stars
1.7k
Forks
503
Avg merge
1d 5h
Merged PRs (30d)
18

Description

### Describe the bug

Not able to consume values returned by a Lambda Authorizer; they are not there even if they are present in the input JSON

### Expected Behavior

Dictionary properly set with keys and values

### Current Behavior

No values

### Reproduction Steps

Websocket API with an authorizer; try to access any authorizer context property (like principalId)
Use the new "Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer" (which is default)

### Possible Solution

As a workaround, the old "Amazon.Lambda.Serialization.Json.JsonSerializer" using the Newtonsoft library seems to work just fine.

### Additional Information/Context

using Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer
"Authorizer": {
"principalId": {
"ValueKind": 3
},
"integrationLatency": {
"ValueKind": 4
},
"authn": {
"ValueKind": 3
}
}

using the legacy Amazon.Lambda.Serialization.Json.JsonSerializer
"Authorizer": {
"principalId": "***********************",
"integrationLatency": 9516,
"authn": "None"
},

### AWS .NET SDK and/or Package version used

Amazon.Lambda.Serialization.SystemTextJson v2.3.0

### Targeted .NET Platform

.net core 3.1

### Operating System and version

any

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.