Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. WCF problem when changing client proxy credentials (The network logon failed) [solved]

WCF problem when changing client proxy credentials (The network logon failed) [solved]

Scheduled Pinned Locked Moved WCF and WF
wcfsysadminsecurityhelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Calla
    wrote on last edited by
    #1

    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 fails

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

    C 1 Reply Last reply
    0
    • C Calla

      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 fails

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

      C Offline
      C Offline
      Calla
      wrote on last edited by
      #2

      Problem solved. Turned OFF "Simple File Sharing" :doh:

      R 1 Reply Last reply
      0
      • C Calla

        Problem solved. Turned OFF "Simple File Sharing" :doh:

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        Really? That fixed it? Would be interesting to see what the transaction looked like in the failing vs. the successful cases using something like wireshark.


        LinkedIn[^] | Blog[^] | Twitter[^]

        C 1 Reply Last reply
        0
        • R Ray Cassick

          Really? That fixed it? Would be interesting to see what the transaction looked like in the failing vs. the successful cases using something like wireshark.


          LinkedIn[^] | Blog[^] | Twitter[^]

          C Offline
          C Offline
          Calla
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups