469,926 Members | 1,818 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Please help - Passing credentials to windows integrated authentication

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
Nov 18 '05 #1
1 5089
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" <ja****@excite.com> wrote in message
news:uZ**************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Kris van der Mast | last post: by
7 posts views Thread by Wade Wegner | last post: by
2 posts views Thread by Matt F | last post: by
3 posts views Thread by Patrick.O.Ige | last post: by
3 posts views Thread by GRB | last post: by
2 posts views Thread by mbrand | last post: by
reply views Thread by Jesper Lund Stocholm | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.