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

Examples of org.apache.directory.ldap.client.api.message.ModifyRequest.replace()


        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using SMD5
        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
        modReq.replace( "userPassword", "{SMD5}tQ9wo/VBuKsqBtylMMCcORbnYOJFMyDJ" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here


        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using CRYPT
        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
        modReq.replace( "userPassword", "{crypt}qFkH8Z1woBlXw" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

        String adminUserDn = "uid=admin,ou=system";
        connection.bind( adminUserDn, "secret" );

        // now modify the password for akarasulu (while we're admin)
        ModifyRequest modReq = new ModifyRequest( new DN( userDn ) );
        modReq.replace( "userPassword", "newpwd" );
        connection.modify( modReq );
        connection.close();

        connection.bind( userDn, "test" );
        assertFalse( connection.isAuthenticated() );
View Full Code Here

    {
        LdapConnection connection = getAdminConnection();
        DN adminDN = new DN( "uid=admin,ou=system" );
        ModifyRequest req = new ModifyRequest( adminDN );
        String newPwd = "replaced";
        req.replace( SchemaConstants.USER_PASSWORD_AT, newPwd );
        connection.modify( req );
        connection.close();

        connection = getConnectionAs( adminDN, newPwd );
        Entry entry = ( ( SearchResultEntry ) connection.lookup( adminDN.getName() ) ).getEntry();
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.