无法使用“https://accounts.google.com/o/oauth2/v2/auth显示拒绝访问权限启动浏览器

时间:2017-12-29 07:49:24

标签: youtube-data-api

我在我的网络应用程序中使用Youtube V3 .net library。它在我的本地机器上工作正常。但是当我将它部署在我的本地IIS上并在浏览器上尝试时,它会向我显示以下异常:

Failed to launch browser with "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&response_type=code&client_id=201573269273-eoteo6aj8hqq3343qi0qvc6378qt3q22.apps.googleusercontent.com&redirect_uri=http%3A%2F%2F127.0.0.1%3A54419%2Fauthorize%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.upload" for authorization. See inner exception for details.

在内部异常中,它向我显示Access Denied 请帮帮忙。
我正在使用以下代码:

UserCredential credential;
using (var stream = new FileStream(JsonClient, 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 },
        "user",
        CancellationToken.None
    );
    BLL.Error.Insert("UserCredential", "No Error", "No Error");
}

提前致谢。

0 个答案:

没有答案
相关问题