Google api 错误:使用Google Youtube Data API V3 Oauth服务在IIS上拒绝访问
我在Google api 错误:使用Google Youtube Data API V3 Oauth服务在IIS上拒绝访问,google-api,iis-7,youtube-data-api,Google Api,Iis 7,Youtube Data Api,我在asp.net中创建了一个网页(youtubeuploader.aspx),以便在按钮上单击,将视频上传到youtube频道。 视频文件位置如: 'd:\\youtubevdos\\test.3gp. 我已在IIS7中托管了该web应用程序 此页面在本地机器上运行正常,具有适当的Oauth2.0身份验证,并且视频上载到youtube频道但是,如果托管在web服务器上,它将无法工作,我是说IIS服务器 它给出错误: “访问被拒绝”对路径/目录“应用程序数据”的访问被拒绝 UserCredent
asp.net
中创建了一个网页(youtubeuploader.aspx)
,以便在按钮上单击,将视频上传到youtube频道。
视频文件位置如:
'd:\\youtubevdos\\test.3gp.
我已在IIS7
中托管了该web应用程序
此页面在本地机器上运行正常,具有适当的Oauth2.0身份验证
,并且视频
上载到youtube
频道
但是,如果托管在web服务器上,它将无法工作,我是说IIS服务器
它给出错误:
“访问被拒绝”对路径/目录“应用程序数据”的访问被拒绝
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)
);
}
我尝试过以下方法:
- 身份验证时显式设置
文件数据存储
,即将文件位置指定给'D:\websites\myproj\authkey\'
,但仍然存在相同的错误
- 如上所述,在托管位置创建了一个文件夹,并将访问权限设置为文件夹的“FullControl”
,但仍然存在相同错误
注意:我使用的是GoogleAuthorizationCodeFlow
,Google Youtube API v3
,OAuth2.0
有什么建议吗
谢谢你的帮助 尝试此操作-为用户授予应用程序数据文件夹的所有权限-IUSER和网络服务。尝试了IUSER和网络服务,但仍然存在相同问题(