Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

EO WebView Hanging first time when NTLM Auth and https FQDN Options
Tim
Posted: Tuesday, June 12, 2018 7:34:26 AM
Rank: Newbie
Groups: Member

Joined: 1/10/2018
Posts: 8
When opening a page in WebView that requires NTLM authentication on a https fully qualified URL it hangs (does not reach LoadCompleted, stops after BeforeNavigate has completed) only on first initiation of the control from the application. Second time it loads absolutely fine.

- First time load only, next page load and all work fine. Fails 100% of first times when closing host app and restarting, so can be replicated every time.
- http works fine, literally just switching site from https to http.
- Replicated at two completely separate locations both (we can replicate on site with our development box).
- Using latest download of software
- Tried by changing NTLM parameter setting for when it knows to pass creds and not. With getting it to prompt for creds it still goes on to hang.
- This is to a standard ASP.Net site requiring windows authentication.

I currently have no workaround for this issue.
eo_support
Posted: Friday, June 15, 2018 5:46:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,523
Hello,

Sorry about the delay. We are not familiar with details of NTLM authentication. However we were able to debug into Chromium's source code and found out that it fails at line 380 in the following file:

https://cs.chromium.org/chromium/src/net/http/http_auth_sspi_win.cc

This would result in LoadFailed event being triggered with error code ERR_UNEXPECTED, which is the equivalent of ErrorCode.UnexpectedError on the .NET side. As such to workaround this error, you can handle the WebView's LoadFailed event and reload the Url. For example, with the following code based on our TabbedBrowser sample application:

Inside NewWebViewItem function:

Code: C#
//Attach the event handler
item.Page.WebView.LoadFailed += WebView_LoadFailed;

The event handler:

Code: C#
private void WebView_LoadFailed(object sender, LoadFailedEventArgs e)
{
    if (e.ErrorCode == ErrorCode.UnexpectedError)
    {
        EO.WebBrowser.WebView webView = (EO.WebBrowser.WebView)sender;
        Dispatcher.BeginInvoke(new Action(() =>
        {
            webView.Url = e.Url;
        }));
    }
}


Note that:

1. You must use Dispatcher.BeginInvoke to delay the reload since you must allow the first load cycle to complete;
2. You may want to add code to limit the reload to only once to avoid an infinite reload loop due to other unknown scenarios;

Hope this helps.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.