Our app uses the TWebBrowser control from Delphi 10.1 and tries to login to Google Drive using the OAuth2 method (REST.Authenticator.OAuth.WebForm.Win). That worked fine for years.
Now Google obviously considers the TWebBrowser control outdated, giving the message: "This browser or app may not be secure."
I have tried the following potential remedies:
Setting FEATURE_BROWSER_EMULATION in the registry (works for Google maps)
Setting the global session header in the REST FormCreate event:
UserAgent:= 'User-Agent: Chrome/96.0.4664.93'; UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, Pchar(UserAgent), Length(UserAgent), 0);WebBrowser.Navigate(URL, null, null, null, 'User-Agent: Chrome/96.0.4664.93');
None of them work. Did I do something wrong, is there another option, or has Google decided to outdate my Delphi version? Supposedly, updating to Dephi 11 solves the problem by setting TWebBrowser to use the Chrome engine. But I cannot do that at the moment and need a quicker fix.