I am trying to make a call get all users using the okta sdk for dotNet.
I got a lot of features working using the SDK like Get User, Create User and etc,
However, when I try to get all of the users, the call just hangs.
I tried the following methods:
var allUsers = await client.Users.ToArrayAsync();
var allUsers = await client.Users.ToListAsync();
var allUsers = await client.Users.ListUsers().ToArrayAsync();
But, the system just hangs.
The documentation says: The SDK will automatically [paginate] Okta collections for you:
So, I would expect it would not get all of the users and I can some how page through them.
I have no idea what I am doing wrong. Any help would be appreciated.
I have an explanation for this issue but I don’t understand the behavior or how to make it useable for my purposes.
Basically it works, but it takes a really looooooooong time to return the data. (I had to go for a walk and let it run to completion.)
We have close to 60,000 users in test. It looks as though all 60,000 are being returned.
So, my questions are:
The documentation on github says:
List all Users
The SDK will automatically paginate Okta collections for you:
So, why is paging not working automatically? Is there something I have to do?
How can I get paging working. I played around with the limit argument doing something like the below but it still hangs up.
var allUsers = await client.Users.ListUsers(limit: 5).ToArrayAsync();
The ListUsers method should be returning all the results for your query, that’s what it means when it says the SDK handle pagination for you: you shouldn’t need to do anything to ensure that all (matching) users are returned.
The limit arg will just dictate how many results per page, so more API calls will be occurring if you lower the limit to 5.