Active Directory Integration

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
User avatar
Manny Ramirez
Posts: 129
Joined: Tue Mar 06, 2012 3:07 pm
Location: Miami/Puerto Rico
Contact:

Active Directory Integration

Post by Manny Ramirez » Mon Jun 18, 2012 10:10 pm

Is there a way to create users in MS Windows ADS users and computers and synch them or create OD users ? That would be a nice feature to simplify management and security.
Manny Ramirez
Senior Network Engineer
E-ssential Networks LLC

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Active Directory Integration

Post by jordansparks » Sat Jun 23, 2012 4:26 pm

We've dabbled in it, but never had time to work on it too much. Seemed pretty complicated at the time. I'm sure we'll do it some day. I think the reason not much has been done is that it would be too much hassle to switch Windows sessions every time a new user came to the computer. It seems easier to just have one Windows user and switch users in Open Dental. Unless there is faster user switching that I don't know about. But then would you really want to have to open up Open Dental for each user, too?
Jordan Sparks, DMD
http://www.opendental.com

User avatar
Manny Ramirez
Posts: 129
Joined: Tue Mar 06, 2012 3:07 pm
Location: Miami/Puerto Rico
Contact:

Re: Active Directory Integration

Post by Manny Ramirez » Thu Jul 19, 2012 8:00 pm

I see your point. The feature you are talking about is part of MS Windows 7. http://windows.microsoft.com/en-us/wind ... ogging-off
I guess that I am looking at it from a system administrator point of view. For offices without an IT tech it maybe hard to achieve since they would need to know more about creating a domain.
Manny Ramirez
Senior Network Engineer
E-ssential Networks LLC

User avatar
Ardavan
Posts: 106
Joined: Sat May 15, 2010 9:10 am

Re: Active Directory Integration

Post by Ardavan » Wed Aug 20, 2014 6:05 pm

I had written a lengthy write up, however my session timed out and it was lost :( my blog http://geekdental.com has more details, but basically for very rudimentary active directory / LDAP authentication from opendental:

1) Ensure that the OD username matches the active directory logon name

2) Replace the following code in FormLogOn.cs of the project OpenDental:

if(!Userods.CheckTypedPassword(textPassword.Text,selectedUser.Password)) {
MsgBox.Show(this,"Incorrect password");
return;
}

With the following:

try
{
DirectoryEntry de = new DirectoryEntry("LDAP://ldapServer", selectedUser.UserName, textPassword.Text);
DirectorySearcher ds = new DirectorySearcher(de);
ds.Filter = "(sAMAccountName=" + selectedUser.UserName + ")";
SearchResult sr = ds.FindOne();
}
catch (DirectoryServicesCOMException ex)
{ MessageBox.Show(ex.Message, "Directory Services COM Exception"); return; }
catch (COMException ex)
{ MessageBox.Show(ex.Message, "Com Exception"); return; }
catch (NullReferenceException ex)
{ MessageBox.Show(ex.Message, "Null Reference Exception"); return; }
catch (NotSupportedException ex)
{ MessageBox.Show(ex.Message, "Not Supported Exception"); return; }


the code above was ripped out of another project, so all the catch blocks are likely excessive. My employer is sponsoring the development of the plugin mentioned in my blog, but hopefully using the tips above others may bake directory integration directly into opendental (or my employer may donate our work), rendering the plugin redundant. Enjoy!

Post Reply