C
Colin Bowern
I'm trying to make a call inside an ASP.NET web application to an external
quasi-web service (aka FrontPage Server Extensions):
Dim rpcClient As New WebClient
Dim rpcData As New NameValueCollection
Dim rpcResponseArray As Byte()
rpcData.Add("method", "open service:6.0.2.5530")
rpcClient.Credentials = System.Net.CredentialCache.DefaultCredentials
rpcClient.Headers.Add("X-Vermeer-Content-Type",
"application/x-www-form-urlencoded")
rpcResponseArray = rpcClient.UploadValues(currentSite.Url.ToString() +
"/_vti_bin/_vti_aut/author.dll", rpcData)
The app however, is throwing back a 401 Unauthorized. I've been able to
validate the right context is passing through the app by checking
System.Security.Principal.WindowsIdentity.GetCurrent().Name to see the right
user name. And if I create the credential cache manually, it works:
Dim myCreds As New NetworkCredential("userid", "password", "mydomain")
Dim myCache As New CredentialCache
myCache.Add(New Uri("http://dev.mydomain.net/"), "Basic", myCreds)
rpcClient.Credentials = myCache
Any thoughts on why impersonation wouldn't pass through the right
credentials to teh WebClient class in an ASP.NET web application?
Thanks!
Colin
quasi-web service (aka FrontPage Server Extensions):
Dim rpcClient As New WebClient
Dim rpcData As New NameValueCollection
Dim rpcResponseArray As Byte()
rpcData.Add("method", "open service:6.0.2.5530")
rpcClient.Credentials = System.Net.CredentialCache.DefaultCredentials
rpcClient.Headers.Add("X-Vermeer-Content-Type",
"application/x-www-form-urlencoded")
rpcResponseArray = rpcClient.UploadValues(currentSite.Url.ToString() +
"/_vti_bin/_vti_aut/author.dll", rpcData)
The app however, is throwing back a 401 Unauthorized. I've been able to
validate the right context is passing through the app by checking
System.Security.Principal.WindowsIdentity.GetCurrent().Name to see the right
user name. And if I create the credential cache manually, it works:
Dim myCreds As New NetworkCredential("userid", "password", "mydomain")
Dim myCache As New CredentialCache
myCache.Add(New Uri("http://dev.mydomain.net/"), "Basic", myCreds)
rpcClient.Credentials = myCache
Any thoughts on why impersonation wouldn't pass through the right
credentials to teh WebClient class in an ASP.NET web application?
Thanks!
Colin