ctx = new ServerLdapContext( service,
service.getSession( new LdapDN( userDn ), "secret".getBytes() ), new LdapDN( userDn ) );
// now modify the password for akarasulu (while we're admin)
Attribute userPasswordAttribute = new BasicAttribute( "userPassword", "newpwd" );
ctx.modifyAttributes( "", new ModificationItem[] {
new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );
ctx.close();
try
{