【发布时间】:2012-02-28 22:49:22
【问题描述】:
我有一个使用表单身份验证的 Web 项目。我有支持 Windows 身份验证的新要求。这个项目包含两个 Web 服务,一个用于 Silverlight 页面 (MapService),另一个用于各种 ajax 调用 (AsyncService) 现在一切正常,但有两件事我不太明白。
Web.Config 中的配置如下:
<bindings>
<basicHttpBinding>
<binding name="WindowsClientOverTcp">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="AsyncWindowsOverTcp">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="Project.MapService.MapService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="WindowsClientOverTcp" name="WindowsClientOverTcp" contract="Project.MapService.MapService" />
</service>
<service name="Project.AsyncService.AsyncService">
<endpoint address="" binding="webHttpBinding" bindingConfiguration="AsyncWindowsOverTcp" name="AsyncWindowsOverTcp" behaviorConfiguration="Project.AsyncService.AsyncServiceAspNetAjaxBehavior" contract="Project.AsyncService.AsyncService" />
</service>
</services>
有了这个设置,基本上需要使用 SSL 吗?我已经读过将传输安全性与 Windows ClientCredentialType 一起使用会强制使用 HTTPS 端点,这似乎是这种情况。我只是想知道向客户或管理层一般性声明“如果他们想要 Windows 身份验证,我们的应用程序必须使用 https”是否合理
对于 AsyncService,它显然需要来自客户端的 Windows 凭据,但我根本不需要更改我的 JS/Ajax 代码,它仍然可以正常工作。客户端浏览器有什么魔力吗?由于没有客户端配置,我不知道调用是如何进行身份验证的。
谢谢
【问题讨论】:
标签: asp.net wcf web-services windows-authentication