After many hours and tries, finally I am being able to authenticate user
against Novell LDAP. I used the code below to authenticate the user
against Novell LDAP. Here is the issue, in order for me to authenticate
the user, I have to provide full LDAP path to the OU of the users. Since
there is subtree of OU, how can I search the user from the root. This is
how I authenticate myself:string userDN = "CN=" + Username.Value +
",ou=cis,ou=administration,o=University"; // Change to match your
Distinguished Name (DN.

Different users belong to different OU. How can I search the user from
the root without providing full LDAP path to the OU of the user? Below
is the full code:

Code:
--------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.DirectoryServices;
using System.Net;
using Novell.Directory.Ldap;


namespace FormsAuthAD
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Login_Click(object sender, EventArgs e)
{
string userDN = "CN=" + Username.Value + ",ou=cis,ou=administration,o=University"; // Change to match your Distinguished Name (DN)
LdapConnection ldapConn = new LdapConnection();
ldapConn.Connect("10.20.205.41", 389); // 389 is the default port.

try
{
ldapConn.Bind (userDN, Password.Value);
FormsAuthentication.RedirectFromLoginPage(Username .Value, PersistCookie.Checked);
}
catch(LdapException ldapErr)
{
lbl_Msg.Text = "Incorrect username/password combination.";
}

}
}
}


--------------------


--
spyxdaxworld
------------------------------------------------------------------------
spyxdaxworld's Profile: http://forums.novell.com/member.php?userid=122409
View this thread: http://forums.novell.com/showthread.php?t=450531