Please help - Passing credentials to windows integrated authentication

Discussion in 'ASP .Net' started by jadher, Oct 11, 2004.

  1. jadher

    jadher Guest

    I try to access an asp page in a machine that has windows integrated
    authentication turned on.

    I use System.Net.Networkcredentials as well as System.Net.Webrequest and
    Webresponse.

    I receive a response but when I try to use Response.Redirect(), a popup
    windows appears asking me for user, password, domain.

    Is there a way to pass the credentials to the Reponse.Redirect function so I
    do not get prompted for credentials again?

    This is the code i use:
    Dim objCredentials As New System.Net.NetworkCredential
    (strUsername, strPassword, strDomain)
    Dim objCache As New System.Net.CredentialCache
    objCache.Add(New Uri(strURL), "Negotiate", objCredentials)
    Dim objWebRequest As System.Net.WebRequest
    Dim objWebResponse As System.Net.WebResponse
    try
    objWebRequest = System.Net.WebRequest.Create(strURL)
    objWebRequest.Credentials = objCache
    objWebResponse = objWebRequest.GetResponse()

    'I get prompted here
    Response.Redirect(strURL, False)
    Response.Close()
    catch ex as exception
    end try

    Thank you very much
     
    jadher, Oct 11, 2004
    #1
    1. Advertising

  2. No there is not. When you use the WebRequest object on the server, the
    server is making the request, passing the network credentials. When you use
    Response.Redirect, you are instructing the remote client, to make another
    request to the server address you passed it, strURL.

    The remote user then makes the request to strURL; the browser will only send
    the credentials on the machine the remote user is using. I know of no
    workaround.

    HTH,

    bill

    "jadher" <> wrote in message
    news:...
    > I try to access an asp page in a machine that has windows integrated
    > authentication turned on.
    >
    > I use System.Net.Networkcredentials as well as System.Net.Webrequest and
    > Webresponse.
    >
    > I receive a response but when I try to use Response.Redirect(), a popup
    > windows appears asking me for user, password, domain.
    >
    > Is there a way to pass the credentials to the Reponse.Redirect function so

    I
    > do not get prompted for credentials again?
    >
    > This is the code i use:
    > Dim objCredentials As New System.Net.NetworkCredential
    > (strUsername, strPassword, strDomain)
    > Dim objCache As New System.Net.CredentialCache
    > objCache.Add(New Uri(strURL), "Negotiate", objCredentials)
    > Dim objWebRequest As System.Net.WebRequest
    > Dim objWebResponse As System.Net.WebResponse
    > try
    > objWebRequest = System.Net.WebRequest.Create(strURL)
    > objWebRequest.Credentials = objCache
    > objWebResponse = objWebRequest.GetResponse()
    >
    > 'I get prompted here
    > Response.Redirect(strURL, False)
    > Response.Close()
    > catch ex as exception
    > end try
    >
    > Thank you very much
    >
    >
     
    William F. Robertson, Jr., Oct 11, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    0
    Views:
    679
  2. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    Passing credentials to windows integrated authentication

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 26, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,527
    Girish bharadwaj
    Oct 26, 2004
  3. Replies:
    5
    Views:
    3,162
    Nicole Calinoiu
    Jun 8, 2005
  4. Will
    Replies:
    5
    Views:
    2,629
  5. JOS

    Please help Passing Credentials

    JOS, Nov 21, 2006, in forum: ASP .Net Security
    Replies:
    5
    Views:
    235
    Joe Kaplan
    Nov 22, 2006
Loading...

Share This Page