System.Windows.Forms.WebBrowser sometimes does NTLM auth - why?

I have a Windows Forms application targeted at .NET 2.0. I am trying to add one login function through the SAML 2.0 protocol, for which the most effective visible solution is the built-in web browser.

I tested using a dummy application containing only the WebBrowser control that takes place in NTLM exchange. However, when I apparently inject the same control into a larger application, the browser does not respond to the original HTTP 401 request and instead redirects to the IE "Navigation Canceled" page.

Googles did not expect, and I am puzzled by this behavior. Can anyone shed some light on things that might prevent WebBrowser credentials?

+4
source share
1 answer

I found the answer during a linear comparison between a (working) test application and a full (not working) full application.

The key to NTLM permission for me was to set ScriptErrorsSuppressed to false . I intended to hide Javascript popups from our users, but suppressing them also suppresses credential matching. Hover over your mouse.

+3
source

Source: https://habr.com/ru/post/1385826/


All Articles