netTCP binding Soap Security Negotiation Failed

前端 未结 2 1717
孤城傲影
孤城傲影 2021-02-19 01:16

I am writing a WCF service requires impersonate and session.

It is ok when I tried to call it on my local machine, but on the remote machine it always failed with s

2条回答
  •  Happy的楠姐
    2021-02-19 01:37

    There is also a dirty hack, as posted here, here, and here, and analysed here.

    You can supply a dummy Service Principal Name (SPN). In that case, WCF will not fail, but fall back to NTLM for authentication which doesn't verify the principal.

    So, configuration:

        
          
        
    

    and programmatically

        EndpointIdentity identity = EndpointIdentity.CreateSpnIdentity("dummy");
    

    using ChannelFactory:

        Uri uri = new Uri("net.tcp://:/myServiceAddress");
        ChannelFactory channelFactory = new ChannelFactory(new NetTcpBinding());
        channelFactory.CreateChannel(new EndpointAddress(uri, identity)
    

    will also work.

提交回复
热议问题