Results 1 to 1 of 1

Thread: HTTPWebRequest Mimic IE (Windows Authentication)

Threaded View

  1. #1

    Thread Starter
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193

    Exclamation HTTPWebRequest Mimic IE (Windows Authentication)

    Hello, just a quick question, im trying to log on to a page within our intranet that uses Windows Authentication to work out the current user and allows them into the system, (ASP.NET 1.1) I can't get my HTTPWebRequest to authenticate it's just booting me out any ideas? im setting the .Credentials to be the username extracted from User.Identity.Name but it's not enough. Below is the code.

    (u) is a URI Object
    VB Code:
    1. Dim wRequest As HttpWebRequest = HttpWebRequest.CreateDefault(u)
    2.         wRequest.Credentials = Profile.GetCredential(Nothing, "")
    3.         wRequest.PreAuthenticate = True
    4.         wRequest.UnsafeAuthenticatedConnectionSharing = True
    5.         wRequest.UserAgent = " Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
    6.  
    7.         Dim wResponse As HttpWebResponse
    8.         wResponse = wRequest.GetResponse
    Ideally I'd like to mimic the Request so the server thinks it's an IE window
    Thanking in adv

    Sam
    Last edited by señorbadger; Jan 17th, 2007 at 11:28 AM. Reason: Adding ASP.NET 1.1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width