C# 如何将Windows身份验证添加到WCF应用程序
我目前在C#从事一个WCF项目。我对整个.NET领域相当陌生,因为我通常都在做Java,所以请允许我问一个简单的问题: 如何使我的应用程序请求使用Windows密码的凭据(HTTP摘要/Basic)?我在谷歌上搜索了很多次,但很多信息都是误导性的 以下是my web.config当前的外观:C# 如何将Windows身份验证添加到WCF应用程序,c#,.net,wcf,C#,.net,Wcf,我目前在C#从事一个WCF项目。我对整个.NET领域相当陌生,因为我通常都在做Java,所以请允许我问一个简单的问题: 如何使我的应用程序请求使用Windows密码的凭据(HTTP摘要/Basic)?我在谷歌上搜索了很多次,但很多信息都是误导性的 以下是my web.config当前的外观: <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true">
</standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
</configuration>
试试这个:
向下滚动到XML片段
请注意绑定设置中的安全模式:
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>