Package org.apache.directory.ldap.client.api

Examples of org.apache.directory.ldap.client.api.LdapNetworkConnection.bind()


        try
        {
            // Use the client API as JNDI cannot be used to do a search without
            // first binding. (hmmm, even client API won't allow searching without binding)
            connection.bind( "uid=admin,ou=system", "secret" );

            // Searches for all the entries in ou=system
            EntryCursor cursor = connection.search( "ou=system", "(ObjectClass=*)",
                SearchScope.SUBTREE, "*" );

View Full Code Here


        ldapConnection.unBind();

        try
        {
            ldapConnection.bind( "uid=antoine,ou=users,ou=system", "sesame" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            assertTrue( true );
View Full Code Here

    @Test
    public void testSearch100kUsers() throws LdapException, CursorException, InterruptedException
    {
        LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
        connection.bind( "uid=admin,ou=system", "secret" );

        Entry rootPeople = new DefaultEntry(
            "ou=People,dc=example,dc=com",
            "objectClass: top",
            "objectClass: organizationalUnit",
View Full Code Here

    public void testGetSupportedControls() throws Exception
    {
        LdapConnection connection = new LdapNetworkConnection( sslConfig );

        Dn dn = new Dn( "uid=admin,ou=system" );
        connection.bind( dn.getName(), "secret" );

        List<String> controlList = connection.getSupportedControls();
        assertNotNull( controlList );
        assertFalse( controlList.isEmpty() );
View Full Code Here

        {
            connection = new LdapNetworkConnection( tlsConfig );
            tlsConfig.setUseTls( true );
            connection.connect();

            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );

            // try multiple binds with startTLS DIRAPI-173
            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );
View Full Code Here

            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );

            // try multiple binds with startTLS DIRAPI-173
            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );
           
            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );
View Full Code Here

            // try multiple binds with startTLS DIRAPI-173
            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );
           
            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );

            connection.unBind();
        }
        finally
View Full Code Here

        LdapNetworkConnection connection = new LdapNetworkConnection( tlsConfig );
        tlsConfig.setUseTls( true );
        connection.connect();

        Dn dn = new Dn( "uid=admin,ou=system" );
        connection.bind( dn.getName(), "secret" );

        List<String> controlList = connection.getSupportedControls();
        assertNotNull( controlList );
        assertFalse( controlList.isEmpty() );
View Full Code Here

        //sslConfig.setTrustManagers( new NoVerificationTrustManager() );

        LdapNetworkConnection connection = new LdapNetworkConnection( sslConfig );

        // We should get an exception here, as we don't have a trustManager defined
        connection.bind();
    }
}
View Full Code Here

    public void testBindRequest() throws Exception
    {
        LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
        try
        {
            connection.bind( ADMIN_DN, "secret" );

            assertTrue( connection.isAuthenticated() );
        }
        finally
        {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.