【问题标题】:The authentication mechanism is unknown身份验证机制未知
【发布时间】:2011-12-21 13:19:17
【问题描述】:

我正在从活动目录访问用户信息。我的代码在我的本地 PC 上运行良好(有 windows xp,不在域上)。代码是

            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 服务器 2003,在域上)时。它给出了错误“身份验证机制未知”。 让我印象深刻的问题是服务器,在域上无法访问 AD 信息,但我的本地电脑,不在域上可以访问 AD 信息(我得到了 AD_Id 和密码)。

【问题讨论】:

  • 我正在使用 windows 身份验证并在 web.config 文件中将 impersonate 设置为 true。

标签: .net authentication active-directory asp.net-membership account-management


【解决方案1】:

尝试为用户主体或搜索者提供登录凭据。我以前也经历过同样的事情,如果我为我的 AD 连接提供了用户名和密码,它会起作用。

【讨论】:

    猜你喜欢
    • 2019-11-21
    • 2015-04-01
    • 2016-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-17
    • 2019-04-30
    • 1970-01-01
    相关资源
    最近更新 更多