.net 身份验证机制未知
我正在从active directory访问用户信息。我的代码在本地PC上运行良好(使用windows xp,而不是域)。代码是.net 身份验证机制未知,.net,authentication,active-directory,asp.net-membership,account-management,.net,Authentication,Active Directory,Asp.net Membership,Account Management,我正在从active directory访问用户信息。我的代码在本地PC上运行良好(使用windows xp,而不是域)。代码是 PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "domainName", "ActiveDirectoryID", "Password"); UserPrincipal qbeUser = new UserPrincipal(ctx);
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "domainName", "ActiveDirectoryID", "Password");
UserPrincipal qbeUser = new UserPrincipal(ctx);
PrincipalSearcher srch = new PrincipalSearcher(qbeUser);
qbeUser.SamAccountName = "AnyOther_AD_ID"; //To get any one's info
foreach (var found in srch.FindAll())
{
UserPrincipal foundUser = found as UserPrincipal;
if (foundUser != null)
{
emailAddress = foundUser.EmailAddress;
}
}
但当我将应用程序部署到服务器pc(windows server 2003,位于域上)时。它给出错误“身份验证机制未知”。
我想到的问题是服务器,即域上的服务器无法访问广告信息,但我的本地pc(不在域上)可以访问广告信息(我有广告Id和密码)。尝试为用户或搜索者提供登录凭据。我以前也经历过同样的事情,如果我为我的广告连接提供用户名和密码,它就会工作。尝试为用户原则或搜索者提供登录凭据。我以前也经历过同样的事情,如果我提供了带有用户名和密码的广告连接,它就会工作。我正在使用windows身份验证并在web.config文件中将impersonate设置为true。我正在使用windows身份验证并在web.config文件中将impersonate设置为true。