We have a class library that uses the .NET WebBrowser
control to authorize access to a third-party API, either with that third-party's oAuth2 Authorization flow or with Google 2-Step Verification (aka 2-factor/multi-factor authentication, etc).
The first flow works fine; the user is prompted to enter their email and password and click Confirm. No issues.
However the second flow dies once the user confirms (via their mobile device). The pop-up webpage in the WebBrowser
control doesn't move to the verified page, it just sits there as if it's waiting for the user to verify.
Our code implements an event handler for the WebBrowserDocumentCompleted
event and this is fired as expected whenever the page updates. It's not firing after the user confirms via their device, though.
I've had a pretty decent hunt around the web and SO for tips on what's going on, and I've also had a look at WebView2
and CefSharp
but the latter requires an additional C++ library which I'd rather not bundle or have to worry about and the former is in a very new state of development after having spent several hours trying to just get a basic demo working (and failing).
So if it's at all possible, I'd like to nut out a solution which continues to use the WebBrowser
control.
NOTE: I have checked which version is being used and it's 11 based on the Version
property. I'm developing using VS 2019 on a Windows 10 Pro machine targeting .NET 4.5.2 (for maximum backwards compatibility).