I am integrating a web service that will use HTTP POST to request and receive data. Remote server requires basic authentication in accordance with RFC 2617
My authentication attempts fail.
In this case, it doesnβt work, even if I attach the 'NetworkCredential' object to the 'Credentials' property of the HttpWebRequest object, no authentication information is sent in the header, even if I set "PreAuthenticate" = true.
What am I missing?
// a piece is used
NetworkCredential netCredential = new NetworkCredential(" uid", "pwd"); Uri uri = new Uri("http://address of services"); ICredentials credentials = netCredential.GetCredential(uri, "Basic"); objRegistration.Credentials = credentials; objRegistration.PreAuthenticate = true;
Himanshu May 04 '10 at 10:46 a.m. 2010-05-04 10:46
source share