Please help - Passing credentials to windows integrated authentication

J

jadher

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
 
W

William F. Robertson, Jr.

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top