protected AuthenticationInfo buildAuthenticationInfo(String username, char[] password) {
        return new SimpleAuthenticationInfo(username, password, getName());
    }
Builds an {@link AuthenticationInfo} object by querying the active directory LDAP context for the
specified username.  This method binds to the LDAP server using the provided username and password -
which, if successful, indicates that the password is correct.
<p/>
This method can be overridden by subclasses to query the LDAP server in a more complex way.

@param token              the authentication token provided by the user.
@param ldapContextFactory the factory used to build connections to the LDAP server.
@return an {@link AuthenticationInfo} instance containing information retrieved from LDAP.
@throws NamingException if any LDAP errors occur during the search.
core/src/main/java/org/apache/shiro/realm/activedirectory/ActiveDirectoryRealm.java