views:

560

answers:

0

I am using a webbrowser control and loading a website that uses basic authentication. I pass the username and password in the additional header of the navigate routine. The problem is that the header is not retained while navigating the site.

I.E. I log into the site and pass the user name and password in the http header. When I click a link to access another page the header is removed and the site asks for credentials. If I was to just type the site into IE and log in the first time the headers are carried forward on all pages.

Anybody have any ideas how I can have the page retain the headers so the user never has to authenticate?

       Dim sHeaders As String
    Dim HelpBrowser As New WebBrowser

    sHeaders = "Authorization: Basic: " & System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes("UserName:Password")) & Chr(13) & Chr(10)

    Me.HelpBrowser.Navigate("http://www.mysite.com", True, Nothing, sHeaders)