窗体身份验证对Active Directory - LDAP协议窗体、身份验证、协议、Active

由网友(七年之久)分享简介:我需要创建一个网页,对现有的Active Directory用户进行身份验证。域名实际上是一个云计算配置,其中有堆栈上的域控制器和多个其他服务器。 I need to create a web page that authenticates users against an existing active direc...

我需要创建一个网页,对现有的Active Directory用户进行身份验证。域名实际上是一个云计算配置,其中有堆栈上的域控制器和多个其他服务器。

I need to create a web page that authenticates users against an existing active directory. The domain is actually a cloud computing configuration where there is a domain controller and multiple other servers on the stack.

据我所知,可用于从System.DirectoryServices命名空间的对象。不过,我似乎无法路径code到Active Directory通过LDAP://domain.com 地址。目前似乎没有任何的沟通正在进行。我怀疑有一些初始配置必要或安全措施阻止通信。

I understand that objects from the System.DirectoryServices namespace can be used. However, I cant seem to path the code to the active directory through the LDAP://domain.com address. There doesnt seem to be any communication going on. I suspect there is some initial configuration necessary or security measures blocking the communication.

我用这个例子从MSDN工作: http://msdn.microsoft.com/en-us/library/ms180890(v=vs.80).aspx 。

I am working with this example from MSDN: http://msdn.microsoft.com/en-us/library/ms180890(v=vs.80).aspx.

我得到一个错误,指出该服务器不可操作。

I get an error that says the server is not operational.

推荐答案

看看这个链接(取代旧有web.archive.org):

Take a look at this link (replaced old one with web.archive.org):

HTTP://www.$c$cproject.com/KB/system/everythingInAD.aspx#35

这是如何得到默认项:

try
{
    System.DirectoryServices.DirectoryEntry AdRootDSE = new System.DirectoryServices.DirectoryEntry("LDAP://rootDSE");
    string rootdse = System.Convert.ToString(AdRootDSE.Properties["defaultNamingContext"].Value);

    if (!rootdse.StartsWith("LDAP://", StringComparison.OrdinalIgnoreCase) && !rootdse.StartsWith("LDAPS://", StringComparison.OrdinalIgnoreCase))
    {
        rootdse = "LDAP://" + rootdse;
    }

    return rootdse;
}
catch (Exception ex)
{
}
阅读全文

相关推荐

最新文章