public LdapContextFactory getContextFactory() {
        return this.contextFactory;
    }
Returns the LdapContextFactory instance used to acquire connections to the LDAP directory during authentication
attempts and authorization queries.  Unless specified otherwise, the default is a {@link JndiLdapContextFactory}
instance.

@return the LdapContextFactory instance used to acquire connections to the LDAP directory during
authentication attempts and authorization queries
core/src/main/java/org/apache/shiro/realm/ldap/DefaultLdapRealm.java