2

I'm using a WebBrowser control to post to a URL which is password protected. I'm supplying the authorization header but internet explorer still shows the user password popup when it is opened.

webBrowser.Navigate(url, "_blank", Encoding.ASCII.GetBytes(postData), "Content-Type: application/x-www-form-urlencoded" + Environment.NewLine + "Authorization: Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(userpassword)) + Environment.NewLine);

What's more peculiar here is that it doesn't work even if you supply the correct credentials there when the browser window is opened. The popup keeps reappearing.

And it works if I remove the header from above call and supply correct credentials in internet explorer popup window.

user1004959
  • 627
  • 6
  • 16

0 Answers0