【发布时间】:2016-12-21 07:45:43
【问题描述】:
有没有办法获得 Microsoft 集成 Windows 身份验证的行为而无需使用 IIS 进行部署?我们有自己的独立 C#/WCF WebServer,我们想添加这个功能。我们不能将 IIS 用作部署的一部分。
【问题讨论】:
标签: wcf windows-authentication
有没有办法获得 Microsoft 集成 Windows 身份验证的行为而无需使用 IIS 进行部署?我们有自己的独立 C#/WCF WebServer,我们想添加这个功能。我们不能将 IIS 用作部署的一部分。
【问题讨论】:
标签: wcf windows-authentication
WCF 是“自托管”。这意味着,您不必拥有 IIS 即可在服务器上运行它(当然取决于您的实现)。您甚至可以在客户的计算机上运行它。
有关 WCF 身份验证的更多信息,请参阅本文:
Authentication and Authorization in WCF Services
还有这篇文章中的一个例子:
【讨论】:
您可以设置ClientCredentialType
WebHttpBinding whb = ... ;
whb.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
然后通过
获取 WindowsIdentityWindowsIdentity identity = ServiceSecurityContext.Current.WindowsIdentity;
【讨论】: