WCF problem when changing client proxy credentials (The network logon failed) [solved]
-
I'm experiencing difficulties when I try to connect to my WCF Server (hosted as an NT Service) on a Windows XP x64 using my client proxy with another user than the one logged on to the machine. The error message I get from the server is: "A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or ImpersonationLevel. The network logon failed" I have compiled the code explicitly for the x64 platform and for the x86 platform - in other words it's not compiled for AnyCPU. If I run the server on a Windows XP x86 system it works fine - though I'm not sure this is a 32/64 bit problem. The firewall is disabled on all systems. The user should be able to enter other credentials (such as username and password) matching an existing user on the server and then make a connection - but this always fails eventhough the username and password IS correct (I double and tripple checked). My client code for using other client credentials looks like this:
static void Main(string[] args)
{
ProxyClient pxQ = null;
string adr = "net.tcp://10.222.333.444:18888/Service1"; //The IP address is correct, though I used a fake one in this example //
EndpointAddress endpoint = new EndpointAddress(adr);
NetTcpBinding binding = new NetTcpBinding(SecurityMode.Transport); //cannot use SecurityMode.None due to other restriction //
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;pxQ = new ProxyClient(binding, endpoint);
pxQ.ClientCredentials.Windows.ClientCredential = new NetworkCredential("NormalUser", "normal"); // use other credentials //
pxQ.Open(); //This failsConsole.WriteLine(px.GetData(42));
}On the server side it looks like this: ...
ServiceHost svcHost = null;
Service1 svc1 = new Service1();
Uri uri = new Uri("net.tcp://localhost:18888/Service1");
svcHost = new ServiceHost((Object)svc1, uri);NetTcpBinding netTcpBinding = new NetTcpBinding(SecurityMode.Transport);
netTcpBinding.ReceiveTimeout = new TimeSpan(0, 30, 0);netTcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
svcHost.AddServiceEndpoint(typeof(IService1), netTcpBinding, uri);
svcHost.Open();... The server starts without any errors. What am I missing in regards of the authentication, and why does it work on my x86 system? Are there different default settings on x64 and x86 Windows XP. Any suggestions are highly appreciate
-
I'm experiencing difficulties when I try to connect to my WCF Server (hosted as an NT Service) on a Windows XP x64 using my client proxy with another user than the one logged on to the machine. The error message I get from the server is: "A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or ImpersonationLevel. The network logon failed" I have compiled the code explicitly for the x64 platform and for the x86 platform - in other words it's not compiled for AnyCPU. If I run the server on a Windows XP x86 system it works fine - though I'm not sure this is a 32/64 bit problem. The firewall is disabled on all systems. The user should be able to enter other credentials (such as username and password) matching an existing user on the server and then make a connection - but this always fails eventhough the username and password IS correct (I double and tripple checked). My client code for using other client credentials looks like this:
static void Main(string[] args)
{
ProxyClient pxQ = null;
string adr = "net.tcp://10.222.333.444:18888/Service1"; //The IP address is correct, though I used a fake one in this example //
EndpointAddress endpoint = new EndpointAddress(adr);
NetTcpBinding binding = new NetTcpBinding(SecurityMode.Transport); //cannot use SecurityMode.None due to other restriction //
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;pxQ = new ProxyClient(binding, endpoint);
pxQ.ClientCredentials.Windows.ClientCredential = new NetworkCredential("NormalUser", "normal"); // use other credentials //
pxQ.Open(); //This failsConsole.WriteLine(px.GetData(42));
}On the server side it looks like this: ...
ServiceHost svcHost = null;
Service1 svc1 = new Service1();
Uri uri = new Uri("net.tcp://localhost:18888/Service1");
svcHost = new ServiceHost((Object)svc1, uri);NetTcpBinding netTcpBinding = new NetTcpBinding(SecurityMode.Transport);
netTcpBinding.ReceiveTimeout = new TimeSpan(0, 30, 0);netTcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
svcHost.AddServiceEndpoint(typeof(IService1), netTcpBinding, uri);
svcHost.Open();... The server starts without any errors. What am I missing in regards of the authentication, and why does it work on my x86 system? Are there different default settings on x64 and x86 Windows XP. Any suggestions are highly appreciate
-
Yes that was actually all it took.. I'm not really sure of how the Simple File Sharing works, but it seems that if you have it turned on - allowing users within your network to access shared folders without any authentication - you run into problems when you try to access that machine USING a username and password. I've heard about other people running into this issue whenver they try to do something similar.