【问题标题】:Google consent screen not showing up while integrating Google Drive集成 Google Drive 时未显示 Google 同意屏幕
【发布时间】:2015-09-13 04:46:04
【问题描述】:

在我的 ASP.NET Web 应用程序中集成 Google Drive 时遇到问题。它没有显示同意屏幕,用户可以在其中输入他/她的 Google 凭据来授权我的应用程序。

下面是我的代码:

String CLIENT_ID = "XXXXXX";
String CLIENT_SECRET = "XXXXXX";
String APP_USER_AGENT = "<Application - Name>";
string[] scopes = new string[] { DriveService.Scope.Drive };
DriveService service=null;

try
{
    var dbDataStore = new DatabaseDataStore("<DBServer>", "<DBUser>", "<Pwd>", "<DataBase>");
    UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = CLIENT_ID, ClientSecret = CLIENT_SECRET },
            scopes, Convert.ToString(Session["UserId"]), CancellationToken.None, dbDataStore).Result;

    service = new DriveService(new BaseClientService.Initializer()
    {
        HttpClientInitializer = credential,
        ApplicationName = APP_USER_AGENT,
    });
}
catch (Exception ex)
{
}

【问题讨论】:

  • 你有没有让这个工作?很高兴知道解决方案

标签: c# google-oauth


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2020-05-02
    • 2013-12-25
    • 2019-03-02
    • 2021-08-25
    • 2020-01-30
    • 2019-11-06
    • 2016-03-03
    • 2018-09-04
    • 2017-10-23
    相关资源
    最近更新 更多