Git Product home page Git Product logo

Comments (10)

bdemers avatar bdemers commented on August 19, 2024 1

You would need to call client.getDataStore().getResource() instead of client.listUsers for this work around. Similar to #170 (comment), you could build your query this way.

from okta-sdk-java.

bdemers avatar bdemers commented on August 19, 2024

Not directly, but we do have automatic retry logic. Were you programmatically retrying after a failure?

Can you give me an example of how you were iterating over all of your users? How many users did you have?

I ask for two reasons, we could possibly suggest a different approach, and if we add this or similar feature.

All that said, you could use the DataStore client.getDatastore() directly to make any request.

from okta-sdk-java.

SriG86 avatar SriG86 commented on August 19, 2024

The use case is we have a batch which validates data across our systems.If we find discrepancies with data we make necessary changes.

Sometimes this batch might be running and enter our maintenance windows.If we see too many network call failures on our end due to our maintenance window.

we save the getUserPagedResultsWithUrl into file.When our systems are back up we use the saved pagination url to restart the process so that we do not have to reprocess the whole data.

With this new SDK I do not know if this is possible.

from okta-sdk-java.

bdemers avatar bdemers commented on August 19, 2024

@SrihariGanadinni Great info!

You could still do this by using client.getDataStore().getResource("your-href", UserList.class)

You may also want to change your search filter to only return the results from the subset of users you are looking for.

Does this help?

from okta-sdk-java.

bdemers avatar bdemers commented on August 19, 2024

@SrihariGanadinni I'll close this issue, if that doesn't help, please reopen!

from okta-sdk-java.

SriG86 avatar SriG86 commented on August 19, 2024

I started to work on it ,seems like there is no difference ,unless I am missing something,can you provide me an example?

  1. UserList users = client.listUsers(null, "status eq "ACTIVE"", null, null, null);
  2. UserList users = client.getDataStore().getResource("Org url with filter",UserList.class)

Are you suggesting that I execute the first step and then pull the getnexturl from the userlist and then use the second step to getdatastore to get the userlistdata?

from okta-sdk-java.

bdemers avatar bdemers commented on August 19, 2024

Sort of,
You could keep track of an index as you loop through and set the after query param if you are forced to retry.
https://developer.okta.com/docs/api/resources/users.html#request-parameters-2

from okta-sdk-java.

SriG86 avatar SriG86 commented on August 19, 2024

I am trying out the solution that was provided it keeps giving com.okta.sdk.resource.ResourceException: HTTP 400, Okta E0000031 (Invalid search criteria.),

Works:

DEFAULT_FILTER_CRITERIA = "status eq "ACTIVE"";
UserList users = client.listUsers(null, DEFAULT_FILTER_CRITERIA, null, null, null);

Erroring out:

DEFAULT_FILTER_CRITERIA = "status eq "ACTIVE"&limit=150";
UserList users = client.listUsers(null, DEFAULT_FILTER_CRITERIA, null, null, null);

But if I go to postman and execute the criteria like below it works,unless I am missing something.

Works on Postman:

?filter=status%20eq%20%22ACTIVE%22&limit=3&after={OktaaUserID}

from okta-sdk-java.

SriG86 avatar SriG86 commented on August 19, 2024

Okay,now I understand the filter has been simplified to restrict to what is documented in docs page and anything additional is via getdatastore. Probably documentation in examples would help! :)

from okta-sdk-java.

bdemers avatar bdemers commented on August 19, 2024

Agreed, this discussion is helpful to see some of the use cases that we should add some doc for

from okta-sdk-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.