Original Post
At work we use a MS active directory for authentication. I am in the process of creating a web application which will require user authentication but we would like to use the AD to avoid having to force people to have an additional username/password to remember. I've done a bit of googling on the subject but all solution I've found looked really convoluted when what I want to do can be done with a few single lines in C#: I was wondering if there was an as simple way to do this in java seeing how I just want a true/false indication from the AD. I found a possible solution here but it looks like I need a bunch of parameters for the search which I'm not sure I can get. Maybe someone could help me demystify how the code works. More specifically I don't understand the parameters such as "dc=abbl,dc=org". Any help would be really appreciated [smile] edit: I figured I'd be a bit more specific in my query. Basically using the code in the page linked above I'm trying to figure out what parameters need to be fed to the object during initialization. In this case: domain, host, dn. Thing is, I do not have access to the active directory directly (it's handle by some other group and I have no clue who this group is) so I'm wondering if there's a way I can pull this information through either the command prompt or something else. [Edited by - Gazillion on May 19, 2009 1:42:15 PM]
private bool Authenticate(string userName,
string password, string domain)
{
bool authentic = false;
try
{
DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain,
userName, password);
object nativeObject = entry.NativeObject;
authentic = true;
}
catch (DirectoryServicesCOMException) { }
return authentic;
}