保护WCF服务我想使用我在asp.net网站中使用的Active Directory自定义主体,该自定义主体用于托管服务。使用以下代码设置导航网站和自定义校长时一切正常使用NTLM CustomBinding和asp.net中的自定义委托人保护WCF
static void context_AuthenticateRequest(对象发件人,EventArgs e) { CustomIdentity identity; CustomPrincipal principal = GetPrincipalFromCookie();
if (principal == null)
{
... create principal from active directory
... Store Principal in a cookie
}
HttpContext.Current.User = principal;
Thread.CurrentPrincipal = principal;
}
然而,当我做一个WCF调用我的服务会出现一个登录对话框删除行HttpContext.Current.User =在登录主要结果对话框未出现,但就是对我没有用,因为我需要在这为我的应用程序填充WebUserSecurityContext。我使用customBinding使用NTLM
<httpTransport authenticationScheme="Ntlm"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
maxBufferPoolSize="2147483647" proxyAuthenticationScheme="Anonymous"/>
</binding>
</customBinding>
我失去了我的配置,以防止此登录对话框,或是否有更好的办法设置?任何帮助,将不胜感激
嗨AspNetCompatibilityMode已经启用服务 – Shay 2011-05-11 12:09:25