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

Examples of org.apache.directory.ldap.client.api.LdapConnection.lookup()


        connection.modify( new Dn( "uid=12345,ou=system" ),
            new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, "mail" )
            );

        // Get back the entry
        found = connection.lookup( "uid=12345,ou=system" );

        assertNotNull( found );
        assertNull( found.get( "mail" ) );
        assertNotNull( found.get( "userPassword" ) );
        assertEquals( 1, found.get( "userPassword" ).size() );
View Full Code Here


        assertEquals( ResultCodeEnum.SUCCESS, pwdModifyResponse.getLdapResult().getResultCode() );

        // Now try to bind with the new password
        userConnection = getNetworkConnectionAs( ldapServer, "cn=User1,ou=system", "secret1Bis" );

        Entry entry = userConnection.lookup( "cn=User1,ou=system" );

        assertNotNull( entry );

        userConnection.close();
        adminConnection.close();
View Full Code Here

        addUser( adminConnection, "User2", "secret2" );

        LdapConnection userConnection = getNetworkConnectionAs( ldapServer, "cn=User2,ou=system", "secret2" );

        Entry entry = userConnection.lookup( "cn=User2,ou=system" );

        assertNotNull( entry );

        userConnection.close();
View Full Code Here

        addUser( adminConnection, "User3", "secret3" );
        Dn userDn = new Dn( "cn=User3,ou=system" );

        LdapConnection userConnection = getNetworkConnectionAs( ldapServer, "cn=User3,ou=system", "secret3" );

        Entry entry = userConnection.lookup( "cn=User3,ou=system" );

        assertNotNull( entry );

        userConnection.close();
View Full Code Here

        assertEquals( ResultCodeEnum.SUCCESS, pwdModifyResponse.getLdapResult().getResultCode() );

        // Now try to bind with the new password
        LdapConnection userConnection = getNetworkConnectionAs( ldapServer, "cn=User4,ou=system", "secret4Bis" );

        Entry entry = userConnection.lookup( "cn=User4,ou=system" );

        assertNotNull( entry );

        userConnection.close();
        adminConnection.close();
View Full Code Here

            attribute = userEntry.get( "pwdHistory" );
            assertEquals( 2, attribute.size() );

            // Now try to bind with the new password
            userConnection = getNetworkConnectionAs( ldapServer, "cn=User7,ou=system", "secret4Bis" );
            Entry entry = userConnection.lookup( "cn=User7,ou=system" );

            assertNotNull( entry );
        }
        finally
        {
View Full Code Here

        // Now try to bind with the new password
        userConnection = getNetworkConnectionAs( ldapServer, "cn=User11,ou=system", "secret1Bis" );
        userConnection.loadSchema();

        Entry entry = userConnection.lookup( "cn=User11,ou=system", SchemaConstants.ALL_ATTRIBUTES_ARRAY );

        assertNotNull( entry );

        Attribute at = entry.get( SchemaConstants.USER_PASSWORD_AT );
        assertEquals( LdapSecurityConstants.HASH_METHOD_SHA512, PasswordUtil.findAlgorithm( at.getBytes() ) );
View Full Code Here

        bindReq.setSaslMechanism( SupportedSaslMechanisms.PLAIN );

        BindResponse resp = connection.bind( bindReq );
        assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() );

        Entry entry = connection.lookup( userDn );
        assertEquals( "hnelson", entry.get( "uid" ).getString() );

        connection.close();
    }
View Full Code Here

        partition.add( new AddOperationContext( getService().getAdminSession(), ctxEntry ) );

        LdapConnection connection = IntegrationUtils.getAdminConnection( getService() );

        assertNotNull( connection.lookup( "ou=removable" ) );

        // Test removeContextPartition
        getService().removePartition( partition );

        assertNull( connection.lookup( "ou=removable" ) );
View Full Code Here

        assertNotNull( connection.lookup( "ou=removable" ) );

        // Test removeContextPartition
        getService().removePartition( partition );

        assertNull( connection.lookup( "ou=removable" ) );
    }
}
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.