The are several authentication plugins in Joomla. For instance: Authentication - LDAP plugin.
Lightweight Directory Access Protocol (LDAP) is a protocol designed to access directory systems over TCP/IP. Because of this various databases provide an LDAP interface such as Microsoft's Active Directory, Novell's eDirectory, as well as more dedicated LDAP solutions such as OpenLDAP.
Joomla! has had a native LDAP library, JLDAP Joomla 2.5 (changed to JClientLDAP in Joomla 3.x) and a native LDAP authentication plugin. This allows Joomla! to authenticate against LDAP systems out of the box: to configure, go to the Plugin Manager and enable and edit the Authentication - LDAP plugin.
Developer: LDAP from scratch http://community.joomla.org/component/zine/article/507-developer-ldap-from-scratch-sam-moffatt.html
You can use any of them, or create a new one based on the available source code.