PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Set credentials to a web request

Reply

Set credentials to a web request

 
Thread Tools Rate Thread
Old 04-04-2006, 08:24 AM   #1
=?Utf-8?B?Tm9ubmll?=
Guest
 
Posts: n/a
Default Set credentials to a web request


Hi,
I'm trying to run an automated test (using NTime tool) on a web application
(windows authentication). All calls in this web app are intercepted by a
custom httpModule. I'm setting credentials to the web request so that the
authentication passes but this doesn't seem to work:

NetworkCredential obj = new NetworkCredential();
obj.UserName = @"domain\username";
obj.Password = "test123";
HttpWebRequest myRequest = (HttpWebRequest)
HttpWebRequest.Create("https://testsite.com/testapp/samplepage.aspx");
myRequest.Credentials = obj;

Please suggest the solution.
Thanks
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off