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
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