Passing security credentials to ASP from .net

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Passing security credentials to ASP from .net

    Hi All
    Here's my situation. I have a ASP page which requires windows authentication. The page works fine when I access it from IE and I am able to login succesfully.
    Now I am writing some .NET code to access the page. I pass in some data for the form. I always get a 401 error. I am looking for some pointers/sample code that tells me how I can pass windows login credentials to my ASP page. I did try NetworkCredentials but that fails. Below Is my code

    WebClient wc = new WebClient()
    NameValueCollection nvc = new NameValueCollection()
    nvc.Add("cmdSubmit","send")
    nvc.Add("txtMsgText","Test Message")

    byte[] buffer
    buffer = wc.UploadValues(uri,"POST",nvc)
    string streamReader
    streamReader = System.Text.Encoding.Default.GetString(buffer)

    Help will be appreciate

    Thank

    Raj
    Raj Guest

  2. Similar Questions and Discussions

    1. Passing credentials across 2 webservice
      I've 2 webservice. (webservice1, webservice2). and one winform.. The winform calls the webservice1 as follows and sends teh currentLogon BY USING...
    2. Passing credentials problem
      I am at a loss. I have a web service which uses Windows Integrated Security. If I use the following code to call my web service: WServ wserv...
    3. Passing user credentials from ASP.NET to Web Service
      We have an ASP.NET application which needs to call Web Service on another machine using end user's account. The configuration is as follows: *...
    4. Passing Credentials to a Web Service
      Hi Al We have a web service (developed in C#). This web service is hosted in the Partners domain of Microsoft. A Windows Forms application is the...
    5. Network Credentials not passing in Authentication mode
      All -- I've set up a directory where I simply want to know the person's name when he comes into the directory. I've set up the following: *...
  3. #2

    Default Re: Passing security credentials to ASP from .net

    You can pass the credential (user name and password) in the HTTP request.
    Check this article:
    314404 HOWTO: Use Kerberos with the ServerXMLHTTP Component in MSXML

    [url]http://support.microsoft.com/?id=314404[/url]

    HtH,
    Andrea

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.z

    "Raj" <anonymous@discussions.microsoft.com> wrote in message
    news:D81C40BD-0130-4DA7-8A88-1B48638285E3@microsoft.com...
    > Hi All,
    > Here's my situation. I have a ASP page which requires windows
    authentication. The page works fine when I access it from IE and I am able
    to login succesfully.
    > Now I am writing some .NET code to access the page. I pass in some data
    for the form. I always get a 401 error. I am looking for some
    pointers/sample code that tells me how I can pass windows login credentials
    to my ASP page. I did try NetworkCredentials but that fails. Below Is my
    code.
    >
    > WebClient wc = new WebClient();
    > NameValueCollection nvc = new NameValueCollection();
    > nvc.Add("cmdSubmit","send");
    > nvc.Add("txtMsgText","Test Message");
    >
    > byte[] buffer;
    > buffer = wc.UploadValues(uri,"POST",nvc);
    > string streamReader;
    > streamReader = System.Text.Encoding.Default.GetString(buffer);
    >
    >
    > Help will be appreciated
    >
    > Thanks
    >
    > Raj

    Andrea D'Onofrio [MSFT] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139