okta / okta-sdk-java

A Java SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
Apache License 2.0
147 stars 136 forks source link

Updating a user without attempting a create? #178

Closed jordaniac89 closed 6 years ago

jordaniac89 commented 6 years ago

In all of the examples, I see an update of a user always being done immediately after a create. How do I do an update of a user ONLY? Looking in DefaultUserBuilder, it appears that the .build() method is private, which doesn't give me access to a user object without creating one in Okta first.

robertjd commented 6 years ago

Hi @jordaniac89 , did you find the answer to your question?

jordaniac89 commented 6 years ago

I did. It looks I like have to call client.getUser(User) into a User object each time. It would be nice to add functionality to update a user without having to do an API query to retrieve it first each time. As it looks now, I didn't see a way to create a user object (all of the User constructors require an InternalDataStore, which specifies that it's "Not intended to be called by SDK end users!")

jordaniac89 commented 6 years ago

EDIT: I just looked at the Okta API spec: "All profile properties must be specified when updating a user’s profile with a PUT method. Any property not specified in the request is deleted."

I'm guessing that's why the SDK is designed this way :) No worries.