1
votes

I am following the link

http://geekswithblogs.net/frankw/archive/2008/05/18/forms-authentication-with-active-directory-in-asp.net-2.0.aspx

Trying to implement the same in my application.I am confused about the LDAP connection string beacause i don't have any .com as domain.I do have simple domain like this "aaa-bbbb.xxxx".

I m trying this way "LDAP://ipaddress/cn=users,dc=aaa-bbbb,dc=xxxx" and

    <membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
        <providers>
            <add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionStringName="ADConnectionString" connectionUsername="Username" connectionPassword="Password"/>
        </providers>
    </membership>

but i am unable to validate the user ?

1

1 Answers

1
votes

You can easily find out what your LDAP paths look like - just go to LDAP://RootDSE and checkout the various properties there.

Either use some code:

DirectoryEntry deRoot = new DirectoryEntry("LDAP://RootDSE");

if (deRoot != null)
{
    string defNamingCtx = deRoot.Properties["defaultNamingContext"].Value.ToString();
    Console.WriteLine("Default naming context: {0}", defNamingCtx);
}

or a tool like my Beavertail ADSI Browser (written in 100% C# code, and freely available)

enter image description here