Authenticating with LDAP
LDAP is essentially an internet protocol for looking up contact information about users, certificates, network pointers, and more from a server, where the data is stored in a directory-style structure. Of LDAP’s multiple use cases, the most popular is the single sign-on functionality, where a user can access multiple services by logging in to just one, as the credentials are shared across the system.
Getting ready
In this recipe, we will create a login page similar to the one we created in the first recipe of this chapter, Creating a simple session-based authentication. The user can log in using their LDAP credentials. If the credentials are successfully authenticated on the provided LDAP server, the user is logged in.
If you already have an LDAP server that you can access, feel free to skip the LDAP setup instructions explained in this section.
The first step is to get access to an LDAP server. This can be a server already hosted somewhere...