Use LDAP for MySQL authentication?

Solution 1:

Enterprise MySQL (the version you pay Oracle to license) has a PAM module that allows for LDAP authentication: https://dev.mysql.com/doc/refman/5.5/en/pam-pluggable-authentication.html

MariaDB (a binary compatible version of MySQL developed by Monty) has an open source PAM module available for it: http://kb.askmonty.org/en/pam-authentication-plugin/

I do not have hands on experience with either - I present them only as features I have heard of but not tested or used myself.

Solution 2:

You can use the auth_ldap plugin provided by Infoscope Hellas L.P. under GPL.

It can be downloaded from sourceforge here.

(Homepage)

The plugin is still a Beta and works only for UNIX installations.


Solution 3:

A Mysql proxy can enable this for you using roles. More detail can be found here: https://stackoverflow.com/questions/1329963/using-ldap-ad-for-mysql-authenication and here: http://jan.kneschke.de/2009/6/25/mysql-proxy-roles/


Solution 4:

MySQL has a PAM authentication plugin that will let you use any available PAM module to provide authentication services. There is a pam_ldap module that is relatively easy to configure that should allow you to do what you want.

The plugin documentation includes an example using LDAP.


Solution 5:

I have published in my blog, an full example (with source code) of a LDAP Authentication plugin for MySQL.

http://nafiux.com/blog/2012/08/11/mysql-ldap-authentication-plugin/