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

Help wanted : UserResourcesApi.listUserGroups pagination support #1611

Open
dshrestha2025 opened this issue Mar 18, 2025 · 3 comments
Open
Assignees

Comments

@dshrestha2025
Copy link

Using following code only provides first 200 user group membership

var userResourcesApi = new UserResourcesApi(client);
var groups = userResourcesApi.listUserGroups(userId);

However, there are no clear instructions on how we can get paged results for this list

https://developer.okta.com/okta-sdk-java/apidocs/com/okta/sdk/resource/api/UserResourcesApi.html

The doc says additional headers but I am having hard time coming up with the parameters required to get paged list as we can do for listUsers api.

The issue #1286 says this was added to the code but how do we make use of it.

@dshrestha2025
Copy link
Author

It appears that pagination wasn't properly migrated when this was done.
#1594

@prachi-okta
Copy link
Contributor

Hi @dshrestha2025, thanks for reporting this. Have you tried using this - https://developer.okta.com/okta-sdk-java/13.0.2/apidocs/index.html?com/okta/sdk/resource/common/PagedList.html
you can use asNext() to check if more results exist, and getNextPage() to fetch the next set of results.

@dshrestha2025
Copy link
Author

@prachi-okta UserResourcesApi.listUserGroups(userId) is not returning PagedList<>. How can I use asNext() for List<>? Also, this seems to be deprecated in latest version. Is it actually possible to paginate through User.ResourcesApi.listUserGroups? Can you provide me a sample code on how this can be done if possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants