Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UserContextData property for InitiateAuthRequest #160

Open
2 tasks
mgamsjager opened this issue Feb 17, 2025 · 2 comments
Open
2 tasks

Add support for UserContextData property for InitiateAuthRequest #160

mgamsjager opened this issue Feb 17, 2025 · 2 comments
Labels
feature-request A feature should be added or improved. module/cognito-ext p2 This is a standard priority issue queued xs Effort estimation: tiny

Comments

@mgamsjager
Copy link

mgamsjager commented Feb 17, 2025

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

@mgamsjager mgamsjager added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 17, 2025
@ashishdhingra ashishdhingra self-assigned this Feb 17, 2025
@ashishdhingra ashishdhingra added investigating This issue is being investigated and/or work is in progress to resolve the issue. module/cognito-ext p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Feb 17, 2025
@ashishdhingra
Copy link
Contributor

Valid feature request for adding support for UserContextData while using InitiateAuthRequest flow. Perhaps, we should also scan all APIs that this HLL uses that support UserContextDataType.

@ashishdhingra ashishdhingra added needs-review and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Feb 17, 2025
@ashishdhingra ashishdhingra removed their assignment Feb 17, 2025
@ashishdhingra ashishdhingra added xs Effort estimation: tiny queued and removed needs-review labels Feb 17, 2025
@mgamsjager
Copy link
Author

PR created: #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/cognito-ext p2 This is a standard priority issue queued xs Effort estimation: tiny
Projects
None yet
Development

No branches or pull requests

2 participants