2
我有一個使用表單身份驗證的MVC應用程序。此應用程序還承載WCF Web服務(模型)。 Webservice將c#對象添加到應用程序中,並且從應用程序(瀏覽器)外部調用時可以使用與JSON相同的數據。 除了Web服務沒有對任何請求進行身份驗證這一事實外,一切都工作正常。以下是我在web.config中的內容:mvc wcf安全
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<behaviors>
<endpointBehaviors>
<behavior name="ServiceBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webHttpBindingWithJson" crossDomainScriptAccessEnabled="true" />
</webHttpBinding>
</bindings>
<services>
<service name="Services.MyService">
<endpoint address="http://localhost:1234/MyService.svc/" binding="webHttpBinding"
bindingConfiguration="webHttpBindingWithJson"
contract="Services.IService"
behaviorConfiguration="ServiceBehavior"/>
</service>
</services>
我想驗證web服務請求:在應用程序中
- 請求應自動驗證
- 當web服務從應用程序外部調用,用戶被要求進行認證。
任何幫助,將不勝感激。
/d