Hi,
I'm writing a little java web app to handle user's password update through APIs.
I think the code I wrote is correct... I mean, the procedure works properly and passwords are updated.
What's wrong, then?
Well, I've created a couple of test users with a temporary password and passwords were correctly marked as "temporary" in the domain management UI.
Then I tried to update the users' passwords using my web app. I think it worked, because users have now to use the new passwords' values in order to sign in.
*** BUT *** when I last visited the domain management UI, I noticed that the value of the marker/label (what do you call that field?) "temporary" was unchanged! I expected a new value for the marker/label (i.e. "set by admin").
This is the significant snippet of code (Java):
[...]
UserService userService = new UserService(serviceName);
userService.setUserCredentials(adminEmail, adminPassword);
URL retrieveURL = new URL(domainUrlBase + "/" + username);
UserEntry userEntry = userService.getEntry(retrieveURL, UserEntry.class);
userEntry.getLogin().setPassword(newUserPassword);
userService.update(retrieveURL, userEntry);
[...]
The question is: how can I modify the value of the marker/label "set by admin | set by user | temporary", according to the update operation made by my app? I'd like to set the value to "set by admin".
I also thought that I had to set something more, but I didn't find anything useful (userEntry.setUpdated(...)?, ...?).
Other question: when a user is created through APIs the value of the marker/label is "set by user" by default. Why?
Thank you!
Emilio