使用 Google Drive API,我可以使用 OAuth2.0 初始化 DriveService 对象,但不知道如何初始化 Google Provisioning API 的 AppsService 对象以与域组和用户一起使用。我试过了
AppsService _appService = new AppsService("DOMAINNAME", "AuthenticationTokenFromDriveServiceObj");
但是,得到“无效令牌”异常。
- 看起来 Google Provisioning API 仍然无法处理 Google Drive API。我在这里正确吗?
- Google 是否已弃用 Google 配置 API?参考链接https://developers.google.com/google-apps/admin-api-deprecation-list
编辑:
我从以下给出的代码中获取 Drive 服务对象: 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