0

I have created a website in asp.net to store uploaded files on Google Drive using Google Drive API.

Everything works fine on local machine, but on my server when I am accessing my site for drive functionality, I am getting the following Error:

System.UnauthorizedAccessException: Access to the path 'Google.Apis.Auth' is denied.

My authentication code:

var driveCredential =
          GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets {ClientId = CLIENT_ID,ClientSecret = CLIENT_SECRET, }
         ,new[] { DriveService.Scope.Drive }
         ,"user@gmail.com"
         ,CancellationToken.None).Result;

How to resolve this Issue ?

DaImTo
  • 88,623
  • 26
  • 153
  • 389
  • When I host my Application on IIS then also getting same exception message :- System.UnauthorizedAccessException: Access to the path 'Google.Apis.Auth' is denied. – user1578369 Nov 04 '14 at 05:28
  • you also have an extra "," after CLIENT_SECRET (probably unrelated to this issue) – DaImTo Nov 04 '14 at 07:57
  • When we create virtual directory then only face this issue. – user1578369 Nov 04 '14 at 09:01
  • I miss read the error deleted my previous comment. Sounds like permissions issue. have you tried this: http://stackoverflow.com/questions/23405767/system-unauthorizedaccessexception-access-to-the-path-google-apis-auth-is-deni – DaImTo Nov 04 '14 at 09:04
  • I don't have any idea about -- var folder = System.Web.HttpContext.Current.Server.MapPath("/App_Data/MyGoogleStorage"); – user1578369 Nov 04 '14 at 09:13
  • My code work when run using visual studio locally but when Host on IIS then getting exception message. – user1578369 Nov 04 '14 at 09:16

0 Answers0