首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Youtube comments API抛出“权限不足:请求的身份验证范围不足”错误

Youtube comments API抛出“权限不足:请求的身份验证范围不足”错误
EN

Stack Overflow用户
提问于 2019-05-15 07:05:32
回答 1查看 2.3K关注 0票数 2

我正在尝试获取Youtube评论,但它抛出了这个异常-

{"Google.Apis.Requests.RequestError\r\nInsufficient权限:请求的身份验证范围不足。403\r\n错误[\r\n\t消息权限不足:请求的身份验证范围不足。Location - ReasoninsufficientPermissions域全局\r\n]\r\n“}

凭据源代码-

UserCredential credsDataApi = GoogleWebAuthorizationBroker.AuthorizeAsync(
                GoogleClientSecrets.Load(stream).Secrets,
                new[] { YouTubeService.Scope.YoutubeForceSsl, YouTubeService.Scope.Youtubepartner, YouTubeAnalyticsService.Scope.YtAnalyticsReadonly, YouTubeAnalyticsService.Scope.YtAnalyticsMonetaryReadonly, YouTubeAnalyticsService.Scope.Youtube, "https://www.googleapis.com/auth/plus.login" },

                "user",
                CancellationToken.None,
                new FileDataStore(Directory.GetCurrentDirectory() + "\\MetadataAccessToken\\" + channelinfo.DataAPIFileDataStore, true)
                ).Result; 

这就是抛出异常的那一行-

UserCredential credsDataApi = YouTubeHelper.GetUserCredentialForDataAPI(channelinfo);
            var youtubeServiceComments = new YouTubeService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credsDataApi,
                ApplicationName = channelinfo.DataAPIFileDataStore
            });

如果(searchCommentThreadlistResponse.Result.Items.Count >0,则var searchCommentThreadlistRequest = var var searchCommentThreadlistResponse = searchCommentThreadlistRequest.ExecuteAsync();){}

你能帮帮忙吗?

EN

回答 1

Stack Overflow用户

发布于 2019-05-15 07:47:33

我可以用这个范围来修复它-

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56139729

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档