TAdvGMail ExternalBrowser

Hello,

I am using a TAdvGDrive componenent with ExternalBrowser set to True.

When my application is run for the first time, and before it has been authenticated with Google, and the following code is executed, "acc" is immediately returned as false, before the external browser ever has time to be displayed.  How do I get the ".Connect" to wait for a user to either allow or deny permission from within the external browser before ".Connect" returns false?

acc := AdvGDrive.Connect;

Is there a downside to using ExternalBrowser?  I can find nothing in the documentation or on these forums explaining how/why/or when "ExternalBrowser" should be set to true or false.

Thanks,

Mike

Hi,


We are not aware of any issues with using an external browser for authentication with TAdvGDrive.
Does the issue also occur when ExternalBrowser is set to false?
If the problem persists, can you please enable logging and provide the automatically generated LOG file so I can further investigate this?
Logging can be enabled by setting Logging to True and LogLevel to llDetail. The LOG file is placed in your machine's Documents folder by default.
Can you also let me know the name and version of the browser you have configured as default on your machine?

The external browser functionality is intended to be used when the login/authentication pages are not working or not displayed correctly with the built-in browser engine provided by Delphi. It can also be enabled based on personal preference.

The problem does not occur when ExternalBrowser is false.  However when ExternalBrowser is false, the authorization form is displayed as a blank white page with nothing on it.  This causes the application to freeze.  It happens under a Server 2008 Remote Desktop session.  By setting ExternalBrowser to true, the default browser appears (Chrome), but the ".Connect" immediately returns "false", before the user can click "Allow" or "Deny", and in fact before the browser page has time to open.

I have not been able to reproduce this issue.
Can you please enable logging and provide the automatically generated LOG file so I can further investigate this?
Logging can be enabled by setting Logging to True and LogLevel to llDetail. The LOG file is placed in your machine's Documents folder by default.

Here is the code I'm using. 

ShowMessage('a');

AdvGDrive.ExternalBrowser := True;
acc := AdvGDrive.Connect;

ShowMessage('b');


If it matters, tokens are persisted to an ini file (plIniFile).

Here is what happens:

1) The first ShowMessage fires.
2) Then the ".Connect" is called.
3) Within a second or two, the second ShowMessage fires - before the browser page is displayed, so there is no way a user can either allow or deny access - "acc" will always be false.

Again, this is on the first authorization attempt, before the .ini file exists.

I don't see how to attach files to this message (is it possible?), so here are the contents of the LOG file:

20170119T105944:HTTPS GET: https://www.googleapis.com/drive/v2/about/?access_token=
20170119T105946:HTTPS GET RESULT:{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}

20170119T105946:HTTPS GET: https://www.googleapis.com/drive/v2/about/?access_token=
20170119T105946:HTTPS GET RESULT:{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}




Also, when ExternalBrowser is False, this is the blank white window that is displayed when the ".Connect"is issued...



Tried to insert an image to illustrated the blank authorization form, but nothing is showing up.

I have retested this here with our demo for TAdvGMail and both with ExternalBrowser = true or false, I could not see an issue. When ExternalBrowser = true, it shows the default browser (Chrome here) and shows the Google login screen (it instructs the default browser to navigate to this page) This external browser is launched and there is no blocking code in the .Connect method that waits for the authentication & authorization to complete. When authentication & authorization is successful, the event AdvGMail.OnConnected is triggered.
The same applies to the case when ExternalBrowser = false, except that here a dialog is shown with the embedded IE webbbrowser which navigates to the Google login page. If you experience an issue with this, please first look if you effectively use the latest version of the components.