Google Consent Screen Does Not Open

0

I made an application that has the function of backing up to Google Drive, but it does not work when I put it on some server, it works only in localhost .

What happens is that it does not open the consent screen on the servers, it follows the code:

var credencial = GoogleWebAuthorizationBroker.AuthorizeAsync(
    new ClientSecrets 
    { 
        ClientId = clienteID, 
        ClientSecret = clienteSenha 
    }, 
    scopes,
    NomeUsuario,
    CancellationToken.None,
    new FileDataStore("C:\temp\items/" + empresaAtiva, true)).Result;

var servico = new DriveService(new BaseClientService.Initializer
{
    HttpClientInitializer = credencial,
    ApplicationName = "items",
});
    
asked by anonymous 30.03.2017 / 19:30

1 answer

1

It is very likely that the problem is this file access using FileDataStore . Of course, in Azure, you will not have access to that path. Especially if you have Azure App Service.

There are several ways to get around this, but you can not access the disk in this "negligent" way.

Next, see your app settings within the Google developer panel. For there you must configure which domain you can try to connect using the token of your app. It is likely that you now only have localhost , so you should add the domain of your app in Azure as one of the possible ones to connect.

    
31.03.2017 / 10:33