AWS Cognito GetUserList results inconsistent with the set Limit when query is filtered

0

The getUserList API seems to return lesser results than the set limit when a query filter is applied. For example without a filter if the limit is 20, then it returns 20 records. However, when a filter is applied, even if there are more than 20 records that matches the criteria, the API seems to return lesser results. Wondering if anyone has noticed this kind of a behaviour?

asked 3 years ago388 views
3 Answers
0

Can you post the CLI command or API call you are making with the filter included?

AWS
answered 3 years ago
0

Assuming your using ListUser API https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListUsers.html#API_ListUsers_RequestSyntax

Please check if you have PaginationToken which might be link to next list of users. An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

Refer the link above for details.

AWS
answered 3 years ago
0

It looks as though Cognito's ListUsers API returns a sparse result set - according to the Managing and Searching for Users page in the documentation, "ListUsers returns a paginated list of zero or more users. You can receive multiple pages in a row with zero results."

The suggested workaround is to "Repeat the query with each pagination token that is returned until you receive a null pagination token value, then review the combined result."

Note this applies when using the CLI with a client-side filter; it doesn't explicitly state whether the API (and / or SDKs) are similarly affected.

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions