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

CognitoUser.ListDevicesAsync() doesn't support returning pagination token. #106

Closed erikkanderson closed 1 year ago

erikkanderson commented 1 year ago

Describe the feature

This feature request is specific for UserAuthentication.CognitoUser's ListDevicesAsync() method.

Current this method takes a limit (number of devices to return) and a continuation token (to presumable retrieve the next set of devices attached to a user). The limitation of the current implementation is, ListDevicesAsync() only returns the list of devices, it does not return the call's continuation token. Without the initial call to ListDevicesAsync()'s continuation token, it's not possible to get the next set of devices and subsequent calls.

Use Case

To retrieve a complete list of a user's devices, when the user has more than 60 (the maximum limit) devices.

Proposed Solution

No response

Other Information

No response

Acknowledgements

AWS .NET SDK and/or Package version used

Amazon.Extensions.CognitoAuthentication version 2.3.0

Targeted .NET Platform

netstandard2.0 netstandard2.1

Operating System and version

Windows 11

ashishdhingra commented 1 year ago

Just for reference, CognitoUser.ListDevicesAsync() doesn't have ability to return PaginationToken, which is returned from the service as mentioned in the ListDevices API reference.

@erikkanderson Feel free to contribute the feature request. However, kindly note that changing return signature would be a breaking change and method overloading doesn't consider return types. May be following approaches might work:

My hunch about the original design is that it just sets the upper limit for the number of devices to return irrespective of whether there are more devices or not, hence it disregards pagination token. So 2nd approach appears to be the way to go forward.

I have also changed the title of the issue for it to be more descriptive.

ashishdhingra commented 1 year ago

We have implemented new ListDevicesV2Async method in Amazon.Extensions.CognitoAuthentication version 2.4.0 which allows listing additional pages of devices. The response returned from this method contains DeviceType objects which could be used to construct list of CognitoDevice type objects and a PaginationToken which could be used to access remaining device types (if any).

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

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.

erikkanderson commented 1 year ago

Just implemented a call with ListDeviceV2Async, works great. Thank you.