带有Google Apis身份验证错误的C#:拒绝访问“Google.Apis.Auth”路径

时间:2016-01-06 11:48:37

标签: c# asp.net asp.net-mvc youtube-api

您好我正在尝试使用v3 api和C#在youtube上上传vidoe。我收到错误“访问路径'Google.Apis.Auth'被拒绝”

下面是我的代码

var client_secretspath = Server.MapPath("/App_Data/client_secrets.json");
                using (var stream = new FileStream(client_secretspath, FileMode.Open, FileAccess.Read))
                {
                    credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                        GoogleClientSecrets.Load(stream).Secrets, 
                        new[] { YouTubeService.Scope.YoutubeUpload },
                        "user",
                        CancellationToken.None
                    );
                }

此代码在本地正常工作但当我尝试在服务器上传时,它无法正常工作。 我在IIS上设置了完全权限。还要检查更改json文件的物理位置,但仍然遇到此问题。

由于

0 个答案:

没有答案