Describe the bug?
We use the UserAPI. When we call
userApiClient.listUsers(CONTENT_TYPE, null, after, limit, null, search, sortBy, sortOrder)
with the following parameters:
search: profile.accountId eq "xxx" and [type.id](https://type.id/) eq "yyy"
after: 00u1aadtre06z5eVR358
limit: 30
sortBy: profile.employeeNumber
sortOrder: desc
we get this:
com.okta.sdk.resource.client.ApiException: {"errorCode":"E0000031","errorSummary":"Invalid search criteria.","errorLink":"E0000031","errorId":"oae-1ADf2njTOSCk7A-_H2A8w","errorCauses":[{"errorSummary":"Invalid cursor."}]}
Now, the “after
” string is taken from the first call to the same function. So the first time it works, the second fails.
Investigation shows that it only happens when sortBy is set.
What is expected to happen?
The second call, with the after call from the first call should return the next batch of users, just as it does when sortBy
is not set.
What is the actual behavior?
The API returns com.okta.sdk.resource.client.ApiException: {"errorCode":"E0000031","errorSummary":"Invalid search criteria.","errorLink":"E0000031","errorId":"oae-1ADf2njTOSCk7A-_H2A8w","errorCauses":[{"errorSummary":"Invalid cursor."}]}
Reproduction Steps?
you need to have a longer list to search for, use the pagination and do a second call, transferring the after string to the next call.
Additional Information?
(I believe,) We do have the profile enriched with self-defined data. However, all is working well if we don’t use the sortBy
parameter.
Java Version
openjdk version “21.0.4” 2024-07-16 LTS
OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode)
SDK Version
com.okta.sdk:okta-sdk.api:20.0.0
com.okta.sdk:okta-sdk.impl:20.0.0
OS version
several OS, including Linux and
Darwin J90J09F4CY 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:02:12 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6031 arm64