Skip to content

Add support for UserContextData property for InitiateAuthRequest #160

@mgamsjager

Description

@mgamsjager

Describe the feature

To pass on the real client user IP address. Cognito uses the EventContextDataType (https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/CognitoIdentityProvider/TEventContextDataType.html) in the InitiateAuthRequest for this

See example https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/CognitoIdentityProvider/TInitiateAuthRequest.html

var response = client.InitiateAuth(new InitiateAuthRequest 
{
.....
    UserContextData = new UserContextDataType {
        EncodedData = "AmazonCognitoAdvancedSecurityData_object",
        IpAddress = "192.0.2.1"
    }
}

It would be nice to have the option to provide the UserContextData object to the request

Use Case

Make use of the new Cognito plans. These only work correctly if we can pass on the real users IP address

Proposed Solution

Add/up method to add the UserContextData object to the InitiateAuthRequest

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS .NET SDK and/or Package version used

    <PackageReference Include="AWSSDK.CognitoIdentity" Version="3.7.100.63" />
    <PackageReference Include="AWSSDK.CognitoIdentityProvider" Version="3.7.101.63" />

Targeted .NET Platform

.net 8

Operating System and version

linux lambda

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.module/cognito-extp2This is a standard priority issuequeuedxsEffort estimation: tiny

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions