public static boolean authenticate(String username, String password) {
        try {
            String dn = getUid(username);
            if (dn != null) {
                /* Found user - test password */
                if ( testBind( dn, password ) ) {
                    if(logger.isDebugEnabled()) logger.debug("user '" + username + "' authentication succeeded");
                    return true;
                } else {
                    if(logger.isDebugEnabled()) logger.debug("user '" + username + "' authentication failed");
                    return false;
                }
            } else {
                if(logger.isDebugEnabled()) logger.debug("user '" + username + "' not found");
                return false;
            }
        } catch (Exception e) {
            logger.error("Exception:", e);
            return false;
        }
    }
@Ignore
    @Test
    public void testAuthentication() throws Exception {
        String user = "jduke";
        String password = "theduke";

        Assert.assertEquals(true, LdapUtil.authenticate(user, password));
    }