问题
I am in a way of writing the java client on GoogleApps for managing the users and groups.I previously worked on the provisioning api and which is now deprecated. As from the info, Admin Sdk's directory api need to be used. I went to the links that were given but i couldnt find any sample client to start working on the directory api. Please guide me on to get the info or a sample client to start with
Thanks
回答1:
You are right. There is no (Admin SDK) Directory API sample to follow (list of API samples)
If I were you I'd follow the Service Account sample code (I guess that it's what you need to use)
Then you can learn how the client library works looking at the other samples and use it following the Directory API reference
EDIT:
Example of user password reset:
User user = service.users().get(username + '@' + domainName).execute();
user.setHashFunction("SHA-1");
user.setPassword(DigestUtils.sha1Hex(newPassword));
service.users().update(username + '@' + domainName, user).execute();
来源:https://stackoverflow.com/questions/21597550/googleapps-java-client-information