public String getAuthenticationMechanism() {
        return (String) getEnvironmentProperty(Context.SECURITY_AUTHENTICATION);
    }
Returns the type of LDAP authentication mechanism to use when connecting to the LDAP server.
This is a wrapper method for getting the JNDI {@link #getEnvironment() environment template}'s
{@link Context#SECURITY_AUTHENTICATION} property.
<p/>
If this property remains un-configured (i.e. {@code null} indicating the
{@link #setAuthenticationMechanism(String)} method wasn't used), this indicates that the default JNDI
"none" (anonymous) and "simple" authentications are supported automatically.  Any non-null value returned
represents an explicitly configured mechanism (e.g. a SASL or external mechanism). See the
<a href="http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html">JNDI LDAP
Authentication Mechanisms</a> for more information.

@return the type of LDAP authentication mechanism to use when connecting to the LDAP server.
@see <a href="http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html">
http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html</a>
core/src/main/java/org/apache/shiro/realm/ldap/JndiLdapContextFactory.java