Understanding how Spring LDAP authentication works

We saw that we were able to log in using a user defined in the LDAP directory. But what exactly happens when a user issues a login request for a user in LDAP? There are the following three basic steps to the LDAP authentication process:

  1. Authenticate the credentials supplied by the user against the LDAP directory.
  2. Determine the GrantedAuthority object that the user has, based on their information in LDAP.
  3. Pre-load information from the LDAP entry for the user into a custom UserDetails object, for further use by the application.