I'm quite new to using LDAP for authentication I was given few parameters from security group to be implemented in the authentication script.

Code:
Service Account ID: myappsldapadmin 
UID:    myappsldapadmin
Password:   P@ssw0rd    
DN: cn=myappsldapadmin,ou=serviceAccount,o=MyCompany

Groups Name:    myapps 
DN: cn=myapps,ou=groups,o=data
Query/Filter:   
member=*
and this is what i have successful done to authenticate with the server:

Code:
try
{
    //Authenticate the username and password
    using (ldapConnection)
    {
        //Pass in the network creds, and the domain.
        NetworkCredential networkCredential = new NetworkCredential(authUser, authPass);
        //Since we're using unsecured port 389, set to false. If using port 636 over SSL, set this to true.
        ldapConnection.SessionOptions.SecureSocketLayer = false;
        ldapConnection.SessionOptions.VerifyServerCertificate += delegate { return true; };
        //To force NTLM\Kerberos use AuthType.Negotiate, for non-TLS and unsecured, use AuthType.Basic
        ldapConnection.AuthType = System.DirectoryServices.Protocols.AuthType.Basic;
        ldapConnection.Bind(networkCredential);
    }
}
catch (Exception ex)
{
    Response.Write("<br>Error ldapQuery:" + ex);
}
How do I go about getting users information after they supply their username and password?

This is what I got so far but it returns object does not exist. I didn't even know how to supply the password.

Code:
string username = Login1.UserName.ToUpper();
string password = Login1.Password;
string userDN = "cn=myapps,ou=groups,o=data"

System.DirectoryServices.Protocols.SearchRequest request = 
          new System.DirectoryServices.Protocols.SearchRequest(
          username, //specified name
           "cn="+username+","+userDN, //search filter
          System.DirectoryServices.Protocols.SearchScope.Subtree, //scope
          new string[] {"dn","cn"} //attributes
);


System.DirectoryServices.Protocols.SearchResponse response = (System.DirectoryServices.Protocols.SearchResponse)ldapConnection.SendRequest(request);

if(response.Entries.Count == 1)
{
    System.DirectoryServices.Protocols.SearchResultEntry entry = response.Entries[0];
    Response.Write("<br>Query: "+entry.DistinguishedName);
}
else
    Response.Write("<br>Query: Result not found");
This is my attempt using Compare which doesn't seem to work either

Code:
	
		LdapConnection conn = new LdapConnection();
		try
		{
			// connect to the server
			conn.Connect(serverIp, serverPort);
			
			// authenticate to the server
			conn.Bind(authUser, authPass);
			
			LdapAttribute attr = new LdapAttribute("password", "mypassword");
			bool correct = conn.Compare(cn="+username+","+userDN, attr);
			
			Response.Write(correct?"<br>The password is correct.":"The password is incorrect.\n");
			
			// disconnect with the server
			conn.Disconnect();
		}
		catch (LdapException ex)
		{
			if (ex.ResultCode == LdapException.NO_SUCH_OBJECT)
			{
				Response.Write("<br>Error: No such entry");
			}
			else if (ex.ResultCode == LdapException.NO_SUCH_ATTRIBUTE)
			{
				Response.Write("<br>Error: No such attribute");
			}
			else
			{
				Response.Write("<br>Error: " + ex.ToString());
			}
		}