LDAP integration+issues

I would like to authenticate users against LDAP. I'm happy to write code. Is there a correct way of going about this (ie. via plugin), or do I need to resort to hacking the source?

 

I plan to use Net::LDAP Gem.