【发布时间】:2017-05-02 20:37:11
【问题描述】:
我已经实现了用于文件管理的 Google Drive 功能。它在本地系统中运行良好,但每当我将它托管在我的服务器上时,它都会引发以下错误:
System.UnauthorizedAccessException: Access to the path 'Google.Apis.Auth' is denied.
string[] scopes = new string[] { "https://www.googleapis.com/auth/contacts.readonly" };
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets {
ClientId = "clientId", ClientSecret = "clientSecret" },
scopes, "test2", CancellationToken.None, new FileDataStore("Google.Apis.Auth")).Result;
或者,我提供另一个文件夹作为相对路径,代码挂起。
【问题讨论】:
-
你需要显示抛出异常的代码
标签: c# asp.net-mvc google-drive-api unauthorizedaccessexcepti