2017-06-29 81 views
0

我在buttonclick上创建了一个网页(youtubeuploader.aspx)asp.netupload Video to youtube channel。 视频文件的位置说,例如: 'd:\\youtubevdos\\test.3gp'.错误:使用Google Youtube Data API V3 Oauth服务在IIS上拒绝访问

hostedIIS7此Web应用程序。

本页正常工作正常的本地机器Oauth2.0 authenticationVideo上传到youtubechannel但是,它Web服务器上时,不会工作我的意思是IIS服务器

它提供了错误:

“拒绝访问”访问路径/目录“的App_Data”被拒绝。

UserCredential credential; 
//string googleaccesstoken = Server.MapPath("mygooglestorage"); 
string googleaccesstoken = "D:\\websites\\mygooglestorage\\"; 
//using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read)) 
using (var stream = new FileStream(jsonpath, FileMode.Open, FileAccess.Read)) 
{ 

    credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
     GoogleClientSecrets.Load(stream).Secrets, 
     // This OAuth 2.0 access scope allows an application to upload files to the 
     // authenticated user's YouTube channel, but doesn't allow other types of access. 
     new[] { YouTubeService.Scope.YoutubeUpload, YouTubeService.Scope.YoutubeUpload, YouTubeService.Scope.Youtube }, 
     "user", 
     CancellationToken.None, 
     new FileDataStore(googleaccesstoken) 
    ); 
} 

我曾尝试以下方法:

  • 式设置FileDataStore而认证即指定文件位置的东西'D:\websites\myproj\authkey\'但还是同样的错误。

  • 在上面给出的托管位置创建了一个文件夹,并给出access rights作为'FullControl'到文件夹仍然相同的错误。

注:我使用GoogleAuthorizationCodeFlowGoogle Youtube API v3OAuth2.0

有什么建议?

帮助赞赏!

回答

0

试试这个 - 授予用户的应用程序数据文件夹的所有权限 - IUSER和网络服务。

+0

尝试与IUSER和网络服务,但仍然同样的问题.. :( –