okta / okta-sdk-dotnet

A .NET SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
Other
160 stars 100 forks source link

ListUsers() returns active users after suspension unless called couple times. #367

Closed cincom-nuryupin closed 4 years ago

cincom-nuryupin commented 4 years ago

Okta SDK v1.4.2 I'm running integration tests in postman. The sequence is:

  1. suspend two users.
  2. unsuspend two users.

When 2 request is executed ListUsers() return users with status "Active" but they should be "Suspended", therefore logic for unsuspension fails.

HOWEVER, if you call ListUsers().ToList() enough times, it will return correct status, which is "SUSPENDED" for both users.

image

I suspect there has to be some timing issue. Is there a away to avoid this behavior?

laura-rodriguez commented 4 years ago

Hi @cincom-nuryupin ,

Thank you for your question.

This is a well-known issue, you can find more info here: https://developer.okta.com/docs/reference/api/users/#list-users-with-search.

If you already know the userId, use GetUserAsync() instead.

For more details about API issues, I suggest reaching out to our support team ( developers@okta.com ) or post it on the Okta Developer Forum instead. They can examine the details of your particular use case and suggest solutions.