Google Consent screen does not open

Asked

Viewed 90 times

0

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

What happens is that it doesn’t 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",
});
  • Take a look here -> http://stackoverflow.com/questions/27573272/googlewebauthorizationbroker-authorizeasync-hangs

1 answer

1

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

There are several ways around this, but it is certain that you will not be able to access the disk in this way "negligent".

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

  • So Thiago in the case of Azure I have a Virtual Machine, even in this case the Filedatastore would not work?

  • In the case of VM, as long as the application is running with credentials to access the disk, it should work.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.