GoogleApps的Java客户端信息 [英] GoogleApps java client information

查看:99
本文介绍了GoogleApps的Java客户端信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为GoogleApps编写用于管理用户和组的Java客户端。我之前从事过供应api,现在已被弃用。从信息中,需要使用Admin Sdk的目录API。我去了给出的链接,但我无法找到任何示例客户端开始工作目录API。请引导我获取信息或样本客户端开始



谢谢

解决方案

你说得对。没有(Admin SDK)目录API示例要遵循( API样本列表)如果我是你,我会遵循服务帐户示例代码(我想这是您需要使用的)



然后,您可以了解客户端库可以查看其他示例,然后按照使用它目录API参考



编辑:

用户密码重置示例:

  User user = service.users()。get(username +'@'+ domainName).execute(); 
user.setHashFunction(SHA-1);
user.setPassword(DigestUtils.sha1Hex(newPassword));
service.users()。update(username +'@'+ domainName,user).execute();


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

解决方案

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();

这篇关于GoogleApps的Java客户端信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆