http://blogs.msdn.com/drnick/archive/2007/03/23/preventing-anonymous-access.aspxWCF的wsHttpBinding和禁用匿名访问
有人可以澄清是否有可能在WCF使用的wsHttpBinding和禁用IIS匿名访问,而运输(SSL)或消息安全被要求?
http://blogs.msdn.com/drnick/archive/2007/03/23/preventing-anonymous-access.aspxWCF的wsHttpBinding和禁用匿名访问
有人可以澄清是否有可能在WCF使用的wsHttpBinding和禁用IIS匿名访问,而运输(SSL)或消息安全被要求?
我们要使用windows集成安全性。如果您在IIS中禁用匿名访问并仅允许Windows,则您似乎无法使用wsHttpBinding和WCF,而无需使用某种安全模式(例如需要ssl的transprot安全性)。
我们只想使用Windows身份验证,我们不一定希望使用SSL来传输安全性。
我有点惊讶,这是不可能的(这似乎是由我的链接确认),因为它似乎是一个实习生应用程序的常见情况。
我们不想降级到仅支持Windows身份验证的basicHttpBinding。
你是对的,afaik在你描述的场景中wsHttpBinding要求我们使用内部的WCF安全堆栈。所以,你通常会做的是
这是一个可以接受的解决方案吗?或者还有其他的东西可以共同使用吗? nsider?
基本实施例:
public class TestService : ITestService
{
[PrincipalPermission(SecurityAction.Demand, Name = "testdomain\\administrator")]
public string DoWork()
{
return "Hello World " + Thread.CurrentPrincipal.Identity.Name;
}
}
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="WcfSecurity.Www.TestServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceAuthorization principalPermissionMode="UseWindowsGroups" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="WcfSecurity.Www.TestServiceBehavior" name="WcfSecurity.Www.TestService">
<endpoint address="" binding="wsHttpBinding" contract="WcfSecurity.Www.ITestService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>