Search code examples
ldapshirospring-ldap

Suggestion/Guidance to Implementing LDAP (Active Directory) authentication


Problem Statement:

I am trying to build a custom management system which would require authentication and authorization both. The system needs to have capabilities to manage/create/update/delete users, roles, permissions and groups.

My Design Solution

I am planing to implement this in-house from scratch and would provide authentication and authorization as follows.

Authentication : user would provide their credentials and the system would authenticate if the user is valid or not.

Authorization: once the user is authenticated, based on the user groups and the permissions they could access the requested pages on the site.

Question:

Now, my question is that suppose I have this application built successfully and in future my application requires LDAP (active directory) authentication would it be possible to plug in LDAP related features keeping my existing application intact or I would have to re-write the entire or most application using LDAP API's.

I have had a look at at apache shiro and spring security which provides LDAP functionality and they also provide capabilities to manage/create/update/delete users.

As of now I have not yet decided if I would go with either of them or write my own.

Would appreciate if I could get a detailed reponse about how to go about things.

Note: I am a complete newbie to LDAP so please excuse me if I have used some wrong terminology with regards to LDAP.


Solution

  • Security is a serious domain, with lots and lots of hidden complications. I would definitely recommend against implementing this yourself. Since you mention Spring LDAP, I'm guessing you're in a Spring-based project. The obvious choice in such a setup would be the excellent Spring Security project.