aws / aws-sdk-net-extensions-cognito

An extension library to assist in the Amazon Cognito User Pools authentication process
Apache License 2.0
102 stars 49 forks source link

Allow CognitoUser.RespondToCustomAuthAsync to include ClientMetadata #83

Closed Itamaram closed 1 year ago

Itamaram commented 2 years ago

The current implementation of CognitoUser.RespondToCustomAuthAsync does not support setting the ClientMetadata property of the RespondToAuthChallengeRequest object, despite it being supported by the API.

This PR rectifies this by adding a ClientMetadata dictionary property to the RespondToCustomChallengeRequest dto, which is then used in building the RespondToAuthChallengeRequest object.

The new property added to the RespondToCustomChallengeRequest dto is using an object initialiser to ensure backwards compatibility. Without it, consumers upgrading to a version of this package containing this change will experience an ArgumentNullException when calling RespondToCustomAuthAsync as ClientMetadata will be set to new new Dictionary<string, string>(customRequest.ClientMetadata) with customRequest.ClientMetadata being null.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ghost commented 1 year ago

Bump. I need this and I think a lot of people using CustomAuth Flows need it too. Since it is already approved by @ashishdhingra, why is the merge pending since Feb? Do it also needs @normj approval?

ashishdhingra commented 1 year ago

Changes released in Amazon.Extensions.CognitoAuthentication 2.2.3.

ghost commented 1 year ago

Great! Thanks!