2

I have a .net control that inherits from system.windows.forms.webbrowser, it navigates to a url and extracts some data.

The server it navigates to has now changed to use Windows Authentication and now all of the requests fail with a 401 unauthorized.

Is there anyway to tell the system.windows.forms.webbrowser object to use Windows Authentication?

noseratio
  • 59,932
  • 34
  • 208
  • 486
Cogslave
  • 2,513
  • 3
  • 25
  • 35
  • Look at [implementing IAuthenticate](http://stackoverflow.com/a/18619110/1768303). – noseratio Oct 12 '13 at 00:27
  • If you know the username and password, I think you can put them in the URL -- but I would only do this for HTTPS -- https://user:password@website.com -- also if it's just BASIC auth, you can put the username / password into the correct header field in base64 -- (again, only do this if it's HTTPS) -- if you just want it to auto authenticate, maybe switch to using webclient with ".UseDefaultCredentials" set to true? – BrainSlugs83 Oct 14 '13 at 05:39

1 Answers1

2

WebBrowser control is basically an instance of Internet Explorer, so you could try to add the url of your site site to trusted sites zone in Internet Explorer configuration "Internet Options".

If this solves your problem you can also think of doing this programmatically (see this SO question)

Community
  • 1
  • 1
Andrea
  • 11,801
  • 17
  • 65
  • 72
  • I think this fixed the issue, it is hard to tell as the vendor released a newer version of the control and I do not have the source to it to see what was changed. – Cogslave Oct 15 '13 at 06:59