2011-10-10 88 views
2

我目前正在C#中使用WCF項目。我對整個.NET領域都很陌生,因爲我通常在做Java,所以請允許我提出一個簡單的問題:如何將Windows身份驗證添加到WCF應用程序

如何讓我的應用程序請求使用Windows密碼的憑證(HTTP Digest/Basic)?我嘗試了很多谷歌搜索,但很多信息都是誤導性的。

這他我的web.config目前的樣子:

<?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> 

回答