AmazonCognitoIdentityProviderClient.ListUsersInGroupAsync returns a set of 25 users max when there is no limit specified

0

Hi,

Within our Asp.Net MVC Core application, we are using the AWSSDK.CognitoIdentityProvider (version 3.7.101.74).

For one of our use cases, we want to have a list of all users which belong to a certain role/group. Therefore, we use the AmazonCognitoIdentifyProviderClient.ListUsersInGroupAsync method. When calling this method without setting the limit property on the ListUsersInGroupRequest , we expect it will return a list of users belonging to that role/group with a max count of 60 users. Why 60? Because there is a max on the limit property of 60 defined in the api which makes us implicitly think it will not return more then 60 users per request.

However, when we do not set the limit property on the ListUsersInGroupRequest, we always get a list with max 25 users returned. This default of 25 is not documented anywhere which makes it confusing/unclear, what the expected behaviour of the api is when not specifying the limit properety on ListUsersInGroupRequest.

Is it correct to assume the default for limit is 25? If so, can this be documented correctly in the api documentation so expected behaviour is clear?

Thanks in advance

This request will return a list of max 25 users

var usersInGroup = await this.adminAmazonCognitoIdentityProviderClient.ListUsersInGroupAsync(new ListUsersInGroupRequest()
{
   GroupName = "SomeUserGroup",
   UserPoolId = "SomeUserPool"
);

This request will return a list of max 60 users

var usersInGroup = await this.adminAmazonCognitoIdentityProviderClient.ListUsersInGroupAsync(new ListUsersInGroupRequest()
{
   GroupName = "SomeUserGroup",
   UserPoolId = "SomeUserPool",
   Limit = 60
);
asked 2 years ago145 views
1 Answer
0

The ListUsersInGroupAsync method from AWSSDK.CognitoIdentityProvider defaults to returning a maximum of 25 users per request when the Limit property is not explicitly set in the ListUsersInGroupRequest. This default behavior is not clearly documented, causing confusion among developers expecting different results. It's advisable to check the AWS SDK documentation for Cognito Identity Provider for accurate information and consider providing feedback to AWS support for clarification and documentation updates. To retrieve more than 25 users, developers should explicitly set the Limit property in their request.

profile picture
EXPERT
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