I have a C# desktop application that stores login data in a database, and uses that to automatically login to local devices that have an HTTP interface. I am using a WebBroswer control to show the web pages. The automated login works well for form based authentication, but I'm having trouble with basic auth. I have tried to ways. I have a helper class that passes formatted Uri and such to the browser window, which in turn passes it to the webBrowser control's Navigate method:
Here is the point inside the browser window where the navigation is done:
Here are the 2 ways I have tried to pass the login data to the home uri: This one causes a COM error at runtime, with HRESULT: 0x800C000E. It seems to be a security error: StackTrace: at MS.Win32.UnsafeNativeMethods.IWebBrowser2.Navigate2
The second way (and probably the correct way) I am using is to pass the encoded header directly to the browser after a 401 status code is returned. This is the method that is causing the Windows Security login popup.
Can anyone tell me why the security window is popping up, and what process I can use to eliminate or hide it, so my login remains invisible? |
↧
Forcing basic authentication from desktop application
↧