借助Google Drive API,我可以使用OAuth2.0初始化DriveService对象,但不知道如何初始化Google Provisioning API的AppsService对象以与域Gorups和用户一起使用。我试过如何使用Google Provisioning API与Google云端硬盘API一起使用域组和用户?
AppsService _appService = new AppsService(“DOMAINNAME”,“AuthenticationTokenFromDriveServiceObj”);
但是,获得“荣军令牌”例外。
- 看起来Google Provisioning API仍然无法处理Google Drive API。我在这里纠正?
- Google Provisioning API是否被Google弃用?参考链接https://developers.google.com/google-apps/admin-api-deprecation-list
编辑:
我从给定的代码获得驱动服务对象: https://developers.google.com/drive/delegation#instantiate_a_drive_service_object [这里,我尝试添加配置API范围也] 然后
PermissionList permissions = _DriveSevice.Permissions.List("root").Fetch();
string userName = permissions.Items[0].Name;
string authenticationToken = auth.State.AccessToken;
AppsService _AppService = new AppsService("DOMAINNAME", authenticationToken);
_AppsService.RetrieveAllUsers(); //This statement errors out
你是正确的,他们是不同范围,但有没有必要通过2个身份验证工作流程,以推动用户。提出请求时,您只需在两个范围之间放置一个空格。 –
@JayLee是对的 – Jerome