question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extra API Call to okta if I called UserList.iterator() twice in a row.

See original GitHub issue

Assuming we get a userList below: UserList userList = client.listUsers(null, null, null, searchUserCriteria, null); When we first time to invoke iterator(), it returns a normal iterator containing all items in the list. But if we call iterator(), single(), stream() or for(User u: UserList) again, it’ll make another api call to okta. e.g.

  Iterator<User> iterator = userList.iterator();
  if (!iterator.hasNext()) {
      return null;
  }
  return userList.single();

The above code makes two api calls to okta for /api/v1/users. It eventually doubles our traffic which makes us hit the api rate limits unexpectedly.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
xiao904commented, May 6, 2019

e.g. GET /api/v1/users?search=profile.anetUserProfileId+eq+12345678

0reactions
sergiishamrai-oktacommented, Dec 17, 2020

Fixed: https://github.com/okta/okta-sdk-java/pull/287

Read more comments on GitHub >

github_iconTop Results From Across the Web

Number of records returned when calling okta calls with stream
When I call userList.stream().collect(toList()) I then I get all of the user records. Is the stream() method looping through all of the app ......
Read more >
How to iterate through all the data through okta api with limited ...
Anyways how can I iterate through all the groups. I am using the Okta python SDK. Here is my code: import okta from...
Read more >
Spring Boot Reference Documentation
REST Clients: Calling REST Services with RestTemplate and WebClient ... If you accidentally run a web application twice, you see a “Port already...
Read more >
WidgetField-TextWithIcon – Asana
Helpful code snippets will show up in this column. curl https://app.asana.com/api/1.0/users/me \ -H "Authorization ...
Read more >
SailPoint Direct Connectors Administration and Configuration ...
New Connector: SharePoint Online, Okta, SuccessFactors and PeopleSoft ... application is responsible for calling Web APIs on behalf of the connector.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found