谷歌同意屏幕不显示,而整合谷歌驱动器

本文关键字:谷歌 驱动器 显示 屏幕 | 更新日期: 2023-09-27 18:12:34

我有麻烦整合谷歌驱动器在我的ASP。. NET web应用程序。它没有显示同意屏幕,用户可以输入他/她的谷歌凭据来授权我的应用程序。

下面是我的代码:
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)
{
}

谷歌同意屏幕不显示,而整合谷歌驱动器

我对每个google api调用的理解是我们应该获得许可

https://developers.google.com/identity/protocols/OpenIDConnect consentpageexperience

您可以使用https://admin.google.com/AdminHome?chromeless=1#OGX:ManageOauthClients重写权限