aws-lambda-dotnet icon indicating copy to clipboard operation
aws-lambda-dotnet copied to clipboard

The CognitoPreTokenGenerationV2Event does not adhere to the AWS documentation

Open ashishdhingra opened this issue 1 year ago • 2 comments

Discussed in https://github.com/aws/aws-lambda-dotnet/discussions/1792

Originally posted by DizzyDeveloper August 19, 2024 According to the the AWS documentation for the Pre token generation Lambda trigger the claims response of the CognitoPreTokenGenerationV2Event should be able to accept any one of [String, Number, Boolean, Array of strings, numbers, booleans, or a combination of any of these, JSON]. However, at the moment it just accepts a string map? Is there any intention implement the documented specs?

Note, I did a hack around locally by cloning the CognitoPreTokenGenerationV2Event and updating the signature of ClaimsToAddOrOverride property in the AccessTokenGeneration class from:

public Dictionary<string, string> ClaimsToAddOrOverride { get; set; } = new (); to public Dictionary<string, object> ClaimsToAddOrOverride { get; set; } = new ();

and that works. Can something similar be done as part of this repo.

ashishdhingra avatar Aug 26 '24 16:08 ashishdhingra

@DizzyDeveloper Issue has been queued in our internal backlog and should be prioritized soon.

ashishdhingra avatar Aug 26 '24 17:08 ashishdhingra

Looks like Java version and Go version have the same issue.

ashishdhingra avatar Aug 28 '24 18:08 ashishdhingra

Changes released in Amazon.Lambda.CognitoEvents 4.0.0. Kindly note that this is a breaking change and has been explicitly called out in Changelog.

ashishdhingra avatar Sep 06 '24 16:09 ashishdhingra

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Sep 06 '24 16:09 github-actions[bot]