Tina,
Have you tried simply re-packing the header for every request?  I wonder
what is set in the header to say... "Hey, no worries, I am already
authenticated".  I will keep you in the loop on my progress with this;
thanks for sharing your leads.

Travis D. Falls |Consultant, Raft.Net IT | 860.547.4070 |
[EMAIL PROTECTED]
 
 

-----Original Message-----
From: Tina [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 07, 2005 1:00 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] creating a header


Trent,

As it so happens, I've been wrestling with this for the past day.  If you
come up with the answer, I'm very interested.  A few leads for you:

You can create your own web request and set credentials on it.  See
System.Net.WebRequest, System.Net.NetworkCredential, and
System.Net.CredentialCache.
http://www.codeproject.com/csharp/HttpWebRequest_Response.asp 

The problem, as I've discovered, is that lets me get one request across.
Now, if I click on a link on the page that I now bring up (page in the
protected area), I generate a _new_ request.  And need to authenticate
again...  So, so long as you only need something off one page, you're great
with this stuff.  If, as I suspect, you need to do more, I'm very interested
in what answers you find out.


Working code below (note my site uses Basic authentication, rather than NTLM
)
NetworkCredential myCred = new NetworkCredential("username", "password");

CredentialCache myCache = new CredentialCache();

myCache.Add(new Uri("http://localhost/TestHTTPS";), "Basic", myCred);

WebRequest webRequest =
HttpWebRequest.Create("http://localhost/TestHTTPS/WebForm2.aspx";);

webRequest.Credentials = myCache;


WebResponse webResponse = webRequest.GetResponse();

webResponse.Close();

Server.Execute("WebForm2.aspx");        // I now have the credentials from
above, and can execute my original request

  ----- Original Message ----- 
  From: Falls, Travis D (HTSC, CASD) 
  To: '[email protected]' 
  Sent: Friday, January 07, 2005 12:44 PM
  Subject: [AspNetAnyQuestionIsOk] creating a header


  Can someone point me to a tutorial that will show me how to create a
header
  to authenticate to a windows protected site (NTML).  I have a valid user
id
  and password I just don't know how to put the header together to automate
  login.  

  Travis D. Falls |Consultant, Raft.Net IT | 860.547.4070 |
  [EMAIL PROTECTED]



  -----Original Message-----
  From: scaevola637 [mailto:[EMAIL PROTECTED] 
  Sent: Friday, January 07, 2005 12:41 PM
  To: [email protected]
  Subject: [AspNetAnyQuestionIsOk] Re: Sticky Wicket: C#.NET calling ADODB



  HERE is one function that needs converting from vbscript to C#.
  the namespace is ADODB, which is guess is what everyone used in 
  Classic ASP before ASP.NET.  I guess I need a book on Classic ADO.
  The instructions are to Keep using ADO but rewrite into C#.NET.  I 
  am not sure it can be done.

  function OpenAFCPT()
        set adoAFCPT = server.createobject("ADODB.Connection")
        adoAFCPT.commandtimeout = dbCommandTimeOut
        adoAFCPT.open dnsAFCPT, usrAFCPT, pasAFCPT
        set cmdAFCPT = Server.CreateObject("ADODB.Command")
        cmdAFCPT.ActiveConnection = adoAFCPT
        cmdAFCPT.CommandTimeout = dbCommandTimeOut
        cmdAFCPT.CommandType = adCmdStoredProc
        
  end function







  Yahoo! Groups Links








  This communication, including attachments, is for the exclusive use of 
  addressee and may contain proprietary, confidential or privileged 
  information. If you are not the intended recipient, any use, copying, 
  disclosure, dissemination or distribution is strictly prohibited. If 
  you are not the intended recipient, please notify the sender 
  immediately by return email and delete this communication and destroy all
copies.



----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
      
    b.. To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




[Non-text portions of this message have been removed]



 
Yahoo! Groups Links



 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to