藉助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