EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Google Drive login

Posted: 08/03/2016 08:39:22
by Romana Romandini (Standard support level)
Joined: 10/22/2013
Posts: 46

your google drive component needs to open a web page for login,
I opened that page with TWebBrowser until yesterday
but now the browser open "not supported" page and shows nothing.
How can I open that page?
thanks in advance!
Posted: 08/03/2016 10:37:23
by Alexander Ionov (Team)

Thank you for reporting this.

We have the same issue and we'll try to find a solution/workaround for it.
We'll let you know as soon as we have any news.

Best regards,
Alexander Ionov
Posted: 08/04/2016 11:22:29
by Alexander Ionov (Team)

Well, it seems from now, Google allows only Mozilla/5.0 browsers to access their authentication pages. But the embedded browser control states Mozilla/4.0 in the User-Agent HTTP field.

So, we need to change that user agent for TWebBrowser control. In order to do this, please create a TWebBrowser.OnBeforeNavigate2 event handler and place the following code as its body (and add the UrlMon unit to a 'uses' clause):
procedure TfrmLogin.BrowserBeforeNavigate2(ASender: TObject; const pDisp: IDispatch; const URL,
  Flags, TargetFrameName, PostData, Headers: OleVariant; var Cancel: WordBool);
  UserAgent = 'Mozilla/5.0 (compatible)';
  UrlMkSetSessionOption(URLMON_OPTION_USERAGENT_REFRESH, nil, 0, 0);
  UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, PChar(UserAgent), Length(UserAgent), 0);

Now, our sample for GoogleDrive is able to login from within TWebBrowser control again.

Best regards,
Alexander Ionov



Topic viewed 1138 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!