This code demonstrates how to login to a system using LDAP Authentication service To login to any system that uses LDAP server for storing the records of a person.
- You should know the LDAP URL of the server.
- You should know whether it uses LDAPS(Secure) or LDAP for connecting to that particular server.
- I have used here express-session to store session of a particular successful login till that person logs out.
- You have to create a client in your code which will inturn connect to server for binding and authentication.
- You need to pass options for searching a record in LDAP server.
- After searching a successful record it will return with the DN.
- Then for authentication you can bind the DN with the password provided by the user.