【问题标题】:WCF Security: Check client domain credentials from server that is outside the domainWCF 安全性:从域外的服务器检查客户端域凭据
【发布时间】:2015-10-30 20:48:53
【问题描述】:

我们有一个 WCF 服务,它曾经安装在域计算机上。我们的客户能够使用当前用户的域凭据连接到该服务并调用 WCF 方法。

这是我们使用的绑定配置:

<netTcpBinding>
    <binding ...>
        <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="None" />
            <message clientCredentialType="Windows" />
        </security>
    </binding>
</netTcpBinding>

现在由于某些技术原因,我们不得不将服务移至无法加入域的机器上。是否仍然可以使用 WCF 传输安全性进行客户端身份验证?

当客户端尝试调用 WCF 方法时,会收到以下错误:

System.ServiceModel.Security.SecurityNegotiationException: The server has rejected the client credentials. ---> 
System.Security.Authentication.InvalidCredentialException: The server has rejected the client credentials. ---> 
System.ComponentModel.Win32Exception: The logon attempt failed

我已尝试使用runas /netonly 运行该服务。该更改使服务能够使用域凭据连接到后端 SQL 服务器,但它对尝试连接到服务的客户端没有帮助。

我进行了一些搜索并阅读了有关 WCF 模拟、Kerberos 令牌、CredSSP 和其他技术的信息,但我不确定这些技术是否对我的情况有帮助,我应该走哪条路或从哪里开始。谢谢。

【问题讨论】:

    标签: c# wcf windows-authentication kerberos wif


    【解决方案1】:

    您需要在已加入域的服务器上运行您的服务,Windows 身份验证才能正常工作。您可以更改身份验证类型或将此服务移回您的域。

    如果您的用户直接对数据库进行身份验证(通过 Kerberos 双跃点),从域中删除服务器的另一个后果是必须更改数据库身份验证以使用服务帐户。

    【讨论】:

    • 实际上我们的服务使用自己的专用用户帐户连接到数据库,而不是使用客户的身份。但是您是说我无法将自己的身份借给服务(域外)以使其也可以对客户端进行身份验证?
    猜你喜欢
    • 2019-04-13
    • 1970-01-01
    • 2021-08-16
    • 1970-01-01
    • 2011-08-10
    • 1970-01-01
    • 1970-01-01
    • 2012-07-24
    • 1970-01-01
    相关资源
    最近更新 更多