无法访问域控制器时进行WCF Windows身份验证

时间:2018-10-05 20:31:34

标签: c# wcf windows-authentication wcf-binding nettcpbinding

我有一个使用Windows身份验证的WCF服务: 可通过https://subdomain.mydomain.com/MyService.svc使用此服务 当前配置为:

  <netTcpBinding>
    <binding  name="SecureNetTcpBinding">
      <security mode="Transport">
        <transport clientCredentialType="Windows" />
        <message clientCredentialType="Windows" />
      </security>
    </binding>
  <netTcpBinding>

客户端使用SPN对服务器进行身份验证(spn:MyService / subdomain.mydomain.com)。

当用户通过VPN连接到域时,身份验证工作正常。但是当VPN断开连接时,他无法连接:一条错误消息,指出找不到域控制器:

System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The system cannot contact a domain controller to service the authentication request. Please try again later

那么有人可以告诉我是否有可能使这种情况成为可能?

更新1: 我想要的方案是像在浏览器中一样使用Windows身份验证:浏览器发送Windows身份验证,并且不需要与域控制器建立连接。它可以在VPN关闭的情况下使用。

1 个答案:

答案 0 :(得分:0)

实际上,我认为答案隐藏在您的问题中。 由于SPN需要某种配置才能正常工作(check this),因此,当VPN连接时,该配置可以正常工作,而断开连接时则可以。

您的问题取决于与身份验证服务(check this too)的连接。当您说浏览器正常工作时,我认为第三方应用程序不起作用?

继续此假设,并且由于浏览器工作正常(我想您是通过启用的Web浏览器测试方法接口调用wcf端点的),因此请检查浏览器是否在使用某些代理。还可以通过其他Web浏览器进行检查。

有人认为值得做的是尝试在关闭VPN的情况下使用soapui或其他soap wcf功能应用程序调用服务,然后看看会发生什么。 另外,检查是否有任何防火墙设置可能不允许未知的代理或应用程序通过您的SPN。在客户端和服务器端。

这是开始调查的好时机。