return new LdapPrincipal( principalDn );
return new LdapPrincipal( principalDn, AuthenticationLevel.SIMPLE );
    public LdapPrincipal authenticate( ServerContext ctx ) throws NamingException    {        // ---- extract password from JNDI environment        Object creds = ctx.getEnvironment().get( Context.SECURITY_CREDENTIALS );        if ( creds == null )        {            creds = ArrayUtils.EMPTY_BYTE_ARRAY;        }        else if ( creds instanceof String )        {            creds = ( ( String ) creds ).getBytes();        }        // ---- extract principal from JNDI environment        String principal;        if ( ! ctx.getEnvironment().containsKey( Context.SECURITY_PRINCIPAL ) )        {            throw new LdapAuthenticationException();        }        else        {            principal = ( String ) ctx.getEnvironment().get( Context.SECURITY_PRINCIPAL );            if ( principal == null )            {                throw new LdapAuthenticationException();            }        }        // ---- lookup the principal entry's userPassword attribute        LdapName principalDn = new LdapName( principal );        ContextPartitionNexus nexus = getFactoryConfiguration().getPartitionNexus();        Attributes userEntry;                try        {            userEntry = nexus.lookup( principalDn, new String[] {"userPassword"} );            if ( userEntry == null )            {                throw new LdapAuthenticationException();            }        }        catch( Exception e )        {            throw new LdapAuthenticationException();        }        Object userPassword;        Attribute userPasswordAttr = userEntry.get( "userPassword" );        // ---- assert that credentials match        if ( userPasswordAttr == null )        {            userPassword = ArrayUtils.EMPTY_BYTE_ARRAY;        }        else        {            userPassword = userPasswordAttr.get();            if ( userPassword instanceof String )            {                userPassword = ( ( String ) userPassword ).getBytes();            }        }        if ( ! ArrayUtils.isEquals( creds, userPassword ) )        {            throw new LdapAuthenticationException();        }        return new LdapPrincipal( principalDn );    }