1

I am using Visual Studio 2015 with Update 3. I have a Windows Forms project with a WebBrowser Control.

VisualStudio Version

The program was able to oAuth with google (AdWords, Google Analytics, Google Drive) as expected Monday (and for years prior). Today we get a "Your browser is not supported any more" redirect and are unable to authenticate.

Not Supported

The local version of Internet Explorer is 11.494.10586.0 Internet Explorer Version

When I manually copy the oAuth url to Internet Explorer (not Edge) the oAuth process works fine (however the c# program can obviously not parse the results). The oAuth url also works fine in Edge, Chrome and Firefox.

In the code, the result of WebBrowserControl1.Version is as follows:

{11.0.10586.494}
    Build: 10586
    Major: 11
    MajorRevision: 0
    Minor: 0
    MinorRevision: 494
    Revision: 494
    _Build: 10586
    _Major: 11
    _Minor: 0
    _Revision: 494

Notice how the 494 and 0 are reversed in Visual Studio and Internet Explorer. I am not sure if this is related to the issue or not, but it is a discrepancy that I noticed

I created a new blank Forms project, added a WebBrowser (System.Windows.Forms.WebBrowser). On load there is only one line of code webBrowser1.Navigate( oAuthURL ); This reproduced the error.

Here is the oAuth URL that we are using, for reference (modified client ID and redirect URI)

https://accounts.google.com/o/oauth2/auth?client_id=123456.apps.googleusercontent.com&redirect_uri=https://www.google.com&access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.edit+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fspreadsheets.google.com%2Ffeeds+https%3A%2F%2Fdocs.google.com%2Ffeeds+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&response_type=code&approval_prompt=force

This does coincide with the latest build of Windows, however that could be coincidence. There seems to be a lot of chatter online about similar issues, that may be related.

Is anyone else experiencing this?

Jason Paul
  • 131
  • 1
  • 10

3 Answers3

1

We have the same problem with our application here. We are using OAuth2 from google to have access to Google Calendar API.Looks like the WebBrowserControl of .NET is using IE7 emulation on all installed Internet Explorer versions and I assume that Google is not supporting this version anymore.

I found a good workaround for this in Stackoverflow Question 18333982. Using the code from there I was able to get acccess to OAuth2.

HTH

0

Your real problem is not that your browser is outdated, but that it is called in IE7 emulation mode. Once you change your emulation mode to something higher than 7, for instance 8 (or even 11 if you know user has the browser) OAuth2 begins to work again. Here is the document that describes how you can set the emulation mode:

MSDN

Basically, what you need to do is to add a DWORD value to a key, like:

HKCU\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

MyExeName.exe : DWORD = 8000 (Decimal)
Tuncay Göncüoğlu
  • 1,699
  • 17
  • 21
0

It worked for me following the solution from Tuncay, but the only change is that the value is not 0x00008000 (hexa), but 8000 (decimal) to indicate IE 8.0.

So, follow the indication of his MSDN link to know which value to enter for each IE version.

I entered oauthbrowser64.exe = 9999 which is since today required for the Total Commander "Cloud" plugin, and it works.