【问题标题】:Error: Access Denied on IIS using Google Youtube Data API V3 Oauth service错误:使用 Google Youtube Data API V3 Oauth 服务在 IIS 上拒绝访问
【发布时间】:2017-06-29 09:44:56
【问题描述】:

我在asp.netupload Video to youtube channelbutton click 上创建了一个网页(youtubeuploader.aspx)。 视频文件位置例如: 'd:\\youtubevdos\\test.3gp'.

我在IIS7 中有hosted 这个Web 应用程序。

此页面在本地机器上正常工作,正确的Oauth2.0 authenticationVideo 上传到youtube channel但是,当托管在 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

有什么建议吗?

帮助赞赏!

【问题讨论】:

    标签: google-api iis-7 youtube-data-api


    【解决方案1】:

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

    【讨论】:

    • 尝试了 IUSER 和网络服务,但仍然是同样的问题..:(
    猜你喜欢
    • 2014-04-18
    • 2015-06-03
    • 1970-01-01
    • 2019-01-11
    • 1970-01-01
    • 2015-03-21
    • 2017-01-27
    • 2012-06-01
    • 2015-02-12
    相关资源
    最近更新 更多